/* ===================================================================
   REVER — Login / Acceso institucional
   Identidad Gráfica Veracruz 2024-2030
   Diseño: panel narrativo (héroe) + panel de acceso
   Reutiliza los tokens de color de styles.css (:root)
   =================================================================== */

:root {
    /* Tints derivados de la paleta institucional (sobre fondo claro) */
    --wine-900: #5a0224;
    --wine-700: #850337;   /* P70-16C */
    --wine-500: #A8253C;   /* P60-16C */
    --gold-500: #B28854;   /* P26-5C  */
    --gold-300: #DAC195;   /* P18-10C */
    --gold-100: #f0e3cd;
    --cream:    #faf7f2;
    --cream-2:  #fffdfa;
}

/* Reset puntual para esta pantalla */
.auth-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Inter', sans-serif;
    color: var(--color-text, #2a0612);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ---- Estructura general --------------------------------------- */
.auth-wrap {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* =================================================================
   PANEL HÉROE (narrativa visual)
   ================================================================= */
.auth-hero {
    position: relative;
    flex: 1.05;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    isolation: isolate;
    color: #fff;
    padding: clamp(2rem, 4vw, 4rem);
}

/* ---- Carrusel de imágenes (fondo narrativo) ------------------- */
.auth-hero__carousel {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    will-change: opacity;
}

.hero-slide.is-active {
    opacity: 1;
}

/* Duotono vino → dorado (identidad) + scrim para legibilidad */
.auth-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 82% 12%, rgba(218, 193, 149, 0.40), transparent 46%),
        linear-gradient(165deg,
            rgba(133, 3, 55, 0.90) 0%,
            rgba(90, 2, 36, 0.74) 40%,
            rgba(168, 37, 60, 0.42) 66%,
            rgba(178, 136, 84, 0.46) 100%),
        linear-gradient(to top, rgba(42, 6, 18, 0.85) 0%, transparent 42%);
}

/* Etiqueta superior (gobierno) */
.auth-hero__tag {
    position: absolute;
    top: clamp(1.75rem, 3vw, 2.75rem);
    left: clamp(2rem, 4vw, 4rem);
    right: clamp(2rem, 4vw, 4rem);
    z-index: 2;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 5px rgba(42, 6, 18, 0.5);
}

/* Mensaje institucional */
.auth-hero__message {
    position: relative;
    max-width: 30rem;
    z-index: 2;
}

.auth-hero__eyebrow {
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-300);
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid rgba(218, 193, 149, 0.55);
}

.auth-hero__title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(1.9rem, 3.4vw, 3rem);
    line-height: 1.08;
    margin: 0 0 1rem;
    color: #fff;
    text-shadow: 0 2px 12px rgba(42, 6, 18, 0.45);
    transition: opacity 0.4s ease;
    min-height: 2.4em;
}

.auth-hero__title em {
    font-style: normal;
    color: var(--gold-300);
}

.auth-hero__text {
    font-size: 1.02rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 6px rgba(42, 6, 18, 0.4);
    margin: 0;
}

/* Puntos de navegación del carrusel */
.auth-hero__dots {
    position: absolute;
    bottom: clamp(1.5rem, 3vw, 2.5rem);
    right: clamp(2rem, 4vw, 4rem);
    z-index: 2;
    display: flex;
    gap: 0.6rem;
}

.hero-dot {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.hero-dot:hover {
    background: rgba(255, 255, 255, 0.5);
}

.hero-dot.is-active {
    background: var(--gold-300);
    border-color: var(--gold-300);
    transform: scale(1.15);
}

.hero-dot:focus-visible {
    outline: 2px solid var(--gold-300);
    outline-offset: 3px;
}

/* =================================================================
   PANEL DE ACCESO
   ================================================================= */
.auth-panel {
    flex: 0.95;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3.5rem);
    background:
        radial-gradient(circle at 100% 0%, rgba(218, 193, 149, 0.22), transparent 38%),
        linear-gradient(180deg, var(--cream-2), var(--cream));
}

.auth-card {
    width: 100%;
    max-width: 29rem;
}

/* Logo institucional — protagonista del panel de acceso */
.auth-card__logo {
    display: block;
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card__logo img {
    width: 165%;
    max-width: none;
    margin-left: -32.5%;
    height: auto;
    filter: drop-shadow(0 6px 14px rgba(133, 3, 55, 0.12));
}

.auth-card__eyebrow {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--wine-500);
    margin: 0 0 0.6rem;
}

.auth-card__title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 0.5rem;
    color: var(--color-text, #2a0612);
}

.auth-card__subtitle {
    font-size: 0.95rem;
    color: var(--color-text-muted, #6b4a52);
    margin: 0 0 2rem;
    line-height: 1.5;
}

/* ---- Mensajes del sistema (error / aviso) --------------------- */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: #fdeceb;
    border: 1px solid #f3c9c5;
    border-left: 4px solid var(--wine-500);
    color: #7a1626;
    padding: 0.85rem 1rem;
    border-radius: 0.6rem;
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 1.5rem;
}

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

/* ---- Campos ---------------------------------------------------- */
.auth-field {
    margin-bottom: 1.35rem;
}

.auth-field__label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text, #2a0612);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap__icon {
    position: absolute;
    left: 0.9rem;
    color: var(--gold-500);
    pointer-events: none;
    display: flex;
}

.auth-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.85rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-text, #2a0612);
    background: #fff;
    border: 1.5px solid #d9cabc;
    border-radius: 0.6rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.auth-input::placeholder {
    color: #b3a298;
}

.auth-input:hover {
    border-color: var(--gold-500);
}

.auth-input:focus {
    outline: 0;
    border-color: var(--wine-700);
    box-shadow: 0 0 0 3px rgba(133, 3, 55, 0.16);
}

/* Botón mostrar/ocultar contraseña */
.auth-toggle {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: 0;
    padding: 0.45rem;
    cursor: pointer;
    color: var(--color-text-muted, #6b4a52);
    border-radius: 0.4rem;
    display: flex;
    transition: color 0.15s ease, background 0.15s ease;
}

.auth-toggle:hover {
    color: var(--wine-700);
    background: rgba(133, 3, 55, 0.06);
}

.auth-toggle:focus-visible {
    outline: 2px solid var(--wine-700);
    outline-offset: 2px;
}

/* ---- Botón principal ------------------------------------------ */
.auth-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, var(--wine-700) 0%, var(--wine-900) 100%);
    border: 0;
    border-radius: 0.6rem;
    cursor: pointer;
    box-shadow: 0 6px 16px -6px rgba(133, 3, 55, 0.55);
    transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-submit:hover {
    filter: brightness(1.08);
    box-shadow: 0 10px 22px -8px rgba(133, 3, 55, 0.65);
    transform: translateY(-1px);
}

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

.auth-submit:focus-visible {
    outline: 3px solid var(--gold-500);
    outline-offset: 2px;
}

/* ---- Pie del panel -------------------------------------------- */
.auth-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 1.75rem;
    font-size: 0.8rem;
    color: var(--color-text-muted, #6b4a52);
}

.auth-secure svg {
    color: var(--color-success, #2f7d32);
}

.auth-help {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-text-muted, #6b4a52);
}

.auth-foot {
    margin-top: 2.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border, #e5d9cf);
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.5;
    color: #9a8a82;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 991px) {
    .auth-wrap {
        flex-direction: column;
    }

    .auth-hero {
        flex: none;
        min-height: 46vh;
        padding: clamp(1.5rem, 6vw, 2.5rem);
        justify-content: flex-end;
    }

    .auth-hero__message {
        max-width: 100%;
    }

    .auth-hero__footer {
        display: none;
    }

    .auth-panel {
        flex: none;
    }

    /* En pantallas apiladas el logo vuelve a un tamaño contenido */
    .auth-card__logo img {
        width: 100%;
        max-width: 360px;
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .auth-hero {
        min-height: 0;
        padding-top: 5.5rem;
        padding-bottom: 2rem;
    }

    .auth-hero__title {
        font-size: 1.7rem;
    }

    .auth-hero__text {
        font-size: 0.95rem;
    }

    /* En móviles muy pequeños reforzamos el logo dentro del panel */
    .auth-card__logo {
        display: block;
    }
}

/* =================================================================
   ACCESIBILIDAD
   ================================================================= */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }

    .auth-submit:hover {
        transform: none;
    }
}
