/* ==============================================================================
   Admin Siglo — Hoja de Estilos Dedicada de Autenticación Editorial (auth.css)
   Consistente con el Sistema de Diseño Institucional de El Siglo de Torreón
   ============================================================================== */

:root {
    --auth-bg: #f1f5f9;
    --auth-surface: #ffffff;
    --auth-border: #e2e8f0;
    --auth-border-focus: #2563eb;
    
    --auth-text-main: #0f172a;
    --auth-text-muted: #64748b;
    --auth-text-subtle: #94a3b8;
    
    --auth-primary: #003366;
    --auth-primary-hover: #002244;
    --auth-blue: #2563eb;
    --auth-blue-hover: #1d4ed8;
    --auth-accent: #cc0000;
    
    --auth-danger: #dc2626;
    --auth-danger-bg: #fef2f2;
    --auth-danger-border: #fecaca;
    
    --auth-info: #0284c7;
    --auth-info-bg: #f0f9ff;
    --auth-info-border: #bae6fd;
    
    --auth-success: #16a34a;
    --auth-success-bg: #f0fdf4;
    --auth-success-border: #bbf7d0;

    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Noto Serif", Georgia, serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body.auth-body {
    background-color: var(--auth-bg);
    background-image: 
        radial-gradient(at 0% 0%, rgba(0, 51, 102, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(204, 0, 0, 0.05) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(37, 99, 235, 0.04) 0px, transparent 50%);
    font-family: var(--font-sans);
    color: var(--auth-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Contenedor Principal */
.auth-wrapper {
    width: 100%;
    max-width: 440px;
    margin: auto;
}

/* Card de Login */
.auth-card {
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    box-shadow: 
        0 10px 25px -5px rgba(15, 23, 42, 0.08), 
        0 8px 10px -6px rgba(15, 23, 42, 0.04);
    padding: 2.25rem 2rem;
    position: relative;
    overflow: hidden;
}

/* Borde superior de acento institucional */
.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--auth-primary) 0%, var(--auth-blue) 60%, var(--auth-accent) 100%);
}

/* Cabecera / Marca */
.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-brand-logo-wrap {
    display: inline-block;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0.75rem;
    transition: transform 0.15s ease;
}

.auth-brand-logo-wrap:active {
    transform: scale(0.97);
}

.auth-brand-logo {
    display: block;
    max-width: 210px;
    height: auto;
    margin: 0 auto;
}

.auth-brand-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--auth-primary);
    margin: 0.25rem 0 0;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.auth-brand-title .badge-editorial {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #eff6ff;
    color: var(--auth-blue);
    border: 1px solid #bfdbfe;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--auth-text-muted);
    margin-top: 0.25rem;
}

.auth-welcome-text {
    font-size: 0.875rem;
    color: var(--auth-text-muted);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Botón de Google */
.btn-google {
    width: 100%;
    height: 42px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #334155;
    font-size: 0.925rem;
    font-weight: 600;
    font-family: var(--font-sans);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-google:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
}

.btn-google svg {
    flex-shrink: 0;
}

/* Separador "o" */
.auth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0;
    color: var(--auth-text-subtle);
    font-size: 0.775rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-separator::before,
.auth-separator::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--auth-border);
}

.auth-separator span {
    padding: 0 0.75rem;
}

/* Formulario */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 12px;
    color: var(--auth-text-subtle);
    pointer-events: none;
}

.input-icon-wrapper .form-control {
    width: 100%;
    height: 40px;
    padding: 0 0.85rem 0 2.5rem;
    font-size: 0.925rem;
    font-family: var(--font-sans);
    color: var(--auth-text-main);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-icon-wrapper .form-control:focus {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-icon-wrapper .form-control::placeholder {
    color: #94a3b8;
    font-size: 0.875rem;
}

.password-toggle-wrapper .form-control {
    padding-right: 2.75rem;
}

.btn-toggle-password {
    position: absolute;
    right: 6px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--auth-text-subtle);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.btn-toggle-password:hover {
    color: var(--auth-primary);
}

/* Opciones de Formulario (Recordar) */
.form-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.825rem;
}

.form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--auth-text-muted);
    cursor: pointer;
    user-select: none;
}

.form-checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--auth-blue);
    cursor: pointer;
}

/* Botón de Submit */
.btn-auth-submit {
    width: 100%;
    height: 42px;
    background-color: var(--auth-primary);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 51, 102, 0.2);
    transition: background-color 0.15s ease, transform 0.1s ease;
    margin-top: 0.25rem;
}

.btn-auth-submit:hover:not(:disabled) {
    background-color: var(--auth-primary-hover);
    transform: translateY(-1px);
}

.btn-auth-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-auth-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Alertas de Mensaje */
.alert {
    padding: 0.75rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.4;
}

.alert svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-danger {
    background-color: var(--auth-danger-bg);
    border: 1px solid var(--auth-danger-border);
    color: var(--auth-danger);
}

.alert-info {
    background-color: var(--auth-info-bg);
    border: 1px solid var(--auth-info-border);
    color: var(--auth-info);
}

.alert-success {
    background-color: var(--auth-success-bg);
    border: 1px solid var(--auth-success-border);
    color: var(--auth-success);
}

/* Footer de la Card */
.auth-card-footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--auth-border);
    text-align: center;
}

.auth-security-indicator {
    font-size: 0.75rem;
    color: var(--auth-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.auth-security-indicator svg {
    color: var(--auth-success);
}

.auth-copyright {
    font-size: 0.725rem;
    color: var(--auth-text-subtle);
}

/* Modal Discreto Nativo HTML5 para Acceso Developer (Ctrl+Alt+D) */
dialog.dev-dialog {
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 1.75rem;
    max-width: 400px;
    width: 90%;
    margin: auto;
    background: #ffffff;
}

dialog.dev-dialog::backdrop {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.dev-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--auth-border);
}

.dev-dialog-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--auth-primary);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--auth-text-muted);
    cursor: pointer;
    padding: 0 0.25rem;
}

.btn-close:hover {
    color: var(--auth-danger);
}

/* Responsividad */
@media (max-width: 480px) {
    body.auth-body {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
    }

    .auth-brand-logo {
        max-width: 180px;
    }

    .auth-brand-title {
        font-size: 1.35rem;
    }
}
