/*
 * Pantallas de acceso (inicio de sesión, cambio y recuperación de contraseña).
 * Usan una paleta clara propia: no dependen del tema claro/oscuro de la intranet.
 */

.auth-body {
    --auth-forest: #033f12;
    --auth-forest-2: #05661a;
    --auth-green: #057f14;
    --auth-green-dark: #05661a;
    --auth-green-soft: #e4f2e4;
    --auth-lime: #aac805;
    --auth-yellow: #f8d509;
    --auth-blue: #12a1fa;
    --auth-ink: #17231b;
    --auth-ink-2: #4a5a50;
    --auth-ink-3: #5f6e64;
    --auth-line: #d8e3d9;
    --auth-field: #f5f8f5;
    --auth-danger: #b3261e;
    --auth-danger-soft: #fbe9e7;

    /* Los componentes compartidos (alertas, botones) usan los tokens claros aunque el sistema esté en modo oscuro. */
    --danger: #b3261e;
    --danger-soft: #fbe9e7;
    --success: #057f14;
    --river-blue: #0b6fb0;
    --municipal-yellow: #f8d509;
    --surface-raised: #ffffff;
    --border: rgba(34, 49, 41, 0.14);
    --ink-secondary: #4a5a50;

    margin: 0;
    background: #f2f5f2;
    color: var(--auth-ink);
    color-scheme: light;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.05fr) minmax(460px, 0.95fr);
}

/* ---------- Panel institucional ---------- */

.auth-hero {
    position: relative;
    display: grid;
    min-height: 100vh;
    grid-template-rows: auto 1fr auto;
    gap: 28px;
    overflow: hidden;
    padding: clamp(28px, 4vw, 56px);
    background:
        radial-gradient(900px 520px at 105% 108%, rgba(23, 137, 214, 0.5), transparent 62%),
        radial-gradient(760px 460px at -12% -10%, rgba(168, 209, 63, 0.3), transparent 60%),
        linear-gradient(155deg, var(--auth-forest) 0%, var(--auth-forest-2) 48%, #057f14 100%);
    color: #fff;
    isolation: isolate;
}

/* Curvas de nivel sutiles, evocando el territorio. */
.auth-hero::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: repeating-radial-gradient(circle at 78% 96%, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 34px);
    content: "";
    mask-image: linear-gradient(180deg, transparent 0%, #000 55%);
}

.auth-orbs span {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    animation: auth-float 16s ease-in-out infinite alternate;
}

.auth-orbs span:nth-child(1) {
    top: 12%;
    right: -8%;
    width: 320px;
    height: 320px;
    background: #168a3c;
}

.auth-orbs span:nth-child(2) {
    bottom: 8%;
    left: 18%;
    width: 260px;
    height: 260px;
    background: #12a1fa;
    animation-delay: -6s;
}

.auth-orbs span:nth-child(3) {
    top: 45%;
    left: -6%;
    width: 200px;
    height: 200px;
    background: rgba(240, 196, 0, 0.5);
    animation-delay: -11s;
}

.auth-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-logo-card {
    display: inline-flex;
    padding: 12px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 40px rgba(4, 20, 11, 0.35);
    transition: transform 200ms ease;
}

.auth-logo-card:hover {
    transform: translateY(-2px);
}

.auth-logo-card img {
    display: block;
    width: clamp(180px, 17vw, 250px);
    height: auto;
}

.auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.75rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.auth-pill svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: var(--auth-lime);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-hero-copy {
    align-self: center;
    max-width: 620px;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--auth-lime);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-kicker::before {
    width: 28px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: "";
}

.auth-hero h1 {
    margin: 16px 0 18px;
    font-size: clamp(2.1rem, 3.6vw, 3.55rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.04;
}

.auth-highlight {
    background: linear-gradient(90deg, var(--auth-yellow) 0%, var(--auth-lime) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-hero-copy > p {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: clamp(0.95rem, 1.1vw, 1.08rem);
    line-height: 1.6;
}

.auth-features {
    display: grid;
    gap: 12px;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 470px;
    padding: 13px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    animation: auth-rise 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transition: transform 200ms ease, background 200ms ease, border-color 200ms ease;
}

.auth-features li:nth-child(2) {
    animation-delay: 120ms;
}

.auth-features li:nth-child(3) {
    animation-delay: 240ms;
}

.auth-features li:hover {
    border-color: rgba(159, 211, 127, 0.45);
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(6px);
}

.auth-feature-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(159, 211, 127, 0.3), rgba(67, 143, 197, 0.3));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.auth-feature-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-features strong {
    display: block;
    font-size: 0.92rem;
}

.auth-features span {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.8rem;
}

.auth-hero-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.auth-department {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background: rgba(8, 28, 16, 0.45);
    backdrop-filter: blur(12px);
}

.auth-department img {
    width: 50px;
    height: 50px;
    padding: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 16px rgba(4, 20, 11, 0.3);
    object-fit: contain;
}

.auth-department strong {
    display: block;
    letter-spacing: 0.08em;
}

.auth-department span {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.78rem;
}

.auth-date {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---------- Panel del formulario ---------- */

.auth-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 56px);
    background:
        radial-gradient(circle at 1px 1px, rgba(47, 107, 53, 0.09) 1px, transparent 0) 0 0 / 22px 22px,
        linear-gradient(180deg, #f4f8f3 0%, #e9f0e8 100%);
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: clamp(28px, 3.4vw, 44px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 26px;
    background: #fff;
    box-shadow:
        0 1px 2px rgba(15, 46, 29, 0.05),
        0 30px 70px -20px rgba(15, 46, 29, 0.25);
    animation: auth-rise 650ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Barra de acento superior con los colores institucionales. */
.auth-card::before {
    position: absolute;
    top: 0;
    right: 32px;
    left: 32px;
    height: 4px;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(90deg, var(--auth-green) 0%, var(--auth-lime) 45%, var(--auth-yellow) 70%, var(--auth-blue) 100%);
    content: "";
}

.auth-card > .alert {
    margin-bottom: 18px;
    border-radius: 12px;
}

.auth-mobile-brand {
    display: none;
}

.auth-heading {
    margin-bottom: 28px;
}

.auth-greeting {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 8px;
    border-radius: 999px;
    background: var(--auth-green-soft);
    color: var(--auth-green-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.auth-greeting svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-heading h2 {
    margin: 14px 0 8px;
    color: var(--auth-ink);
    font-size: clamp(1.75rem, 2.4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.12;
}

.auth-heading p {
    margin: 0;
    color: var(--auth-ink-2);
    font-size: 0.92rem;
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field label,
.auth-label-row label {
    color: #2c3d33;
    font-size: 0.84rem;
    font-weight: 750;
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-link {
    color: var(--auth-green);
    font-size: 0.8rem;
    font-weight: 750;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--auth-green-dark);
    text-decoration: underline;
}

.auth-input {
    position: relative;
    display: flex;
    min-height: 54px;
    align-items: center;
    border: 1.5px solid var(--auth-line);
    border-radius: 14px;
    background: var(--auth-field);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-input:hover {
    border-color: #c2cec4;
}

.auth-input:focus-within {
    border-color: var(--auth-green);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(47, 107, 53, 0.14);
}

.auth-input-icon {
    display: grid;
    width: 50px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--auth-ink-3);
    transition: color 160ms ease;
}

.auth-input:focus-within .auth-input-icon {
    color: var(--auth-green);
}

.auth-input-icon svg,
.auth-eye svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-input input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 14px 14px 14px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--auth-ink);
    font: inherit;
    font-size: 0.95rem;
}

.auth-input input::placeholder {
    color: #9aa59d;
}

/* Evita el fondo amarillo del autocompletado de Chrome. */
.auth-input input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 40px var(--auth-field) inset;
    -webkit-text-fill-color: var(--auth-ink);
}

.auth-eye {
    display: grid;
    width: 48px;
    align-self: stretch;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 0 12px 12px 0;
    background: transparent;
    color: var(--auth-ink-3);
    cursor: pointer;
}

.auth-eye:hover,
.auth-eye:focus-visible {
    color: var(--auth-green);
}

.auth-eye:focus-visible {
    outline: 2px solid var(--auth-green);
    outline-offset: -4px;
}

.auth-eye .icon-hide,
.auth-eye[data-visible="true"] .icon-show {
    display: none;
}

.auth-eye[data-visible="true"] .icon-hide {
    display: block;
}

.auth-capslock {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -8px 0 0;
    color: #9a6b00;
    font-size: 0.78rem;
    font-weight: 700;
}

.auth-capslock[hidden] {
    display: none;
}

.auth-capslock svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-submit {
    position: relative;
    display: inline-flex;
    width: 100%;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #3a8043 0%, var(--auth-green-dark) 100%);
    box-shadow: 0 14px 28px -10px rgba(29, 77, 45, 0.6);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

/* Brillo que recorre el botón al pasar el cursor. */
.auth-submit::after {
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    content: "";
    transform: skewX(-18deg);
    transition: left 600ms ease;
}

.auth-submit:hover {
    box-shadow: 0 18px 34px -10px rgba(29, 77, 45, 0.7);
    filter: brightness(1.05);
    transform: translateY(-2px);
}

.auth-submit:hover::after {
    left: 130%;
}

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

.auth-submit:focus-visible {
    outline: 3px solid rgba(159, 211, 127, 0.9);
    outline-offset: 3px;
}

.auth-submit svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 180ms ease;
}

.auth-submit:hover svg {
    transform: translateX(4px);
}

.auth-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 700ms linear infinite;
}

.auth-submit.is-loading {
    cursor: progress;
    filter: saturate(0.85);
    transform: none;
}

.auth-submit.is-loading svg {
    display: none;
}

.auth-submit.is-loading .auth-spinner {
    display: block;
}

.auth-submit-secondary {
    min-height: 50px;
    border: 1.5px solid var(--auth-line);
    background: #fff;
    box-shadow: none;
    color: var(--auth-ink);
}

.auth-submit-secondary:hover {
    border-color: #c2cec4;
    box-shadow: none;
    filter: none;
}

.auth-submit-secondary::after {
    display: none;
}

.auth-security {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f1f7f0, #eef5f9);
}

.auth-security svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--auth-green);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-security p {
    margin: 0;
    color: var(--auth-ink-2);
    font-size: 0.8rem;
    line-height: 1.5;
}

.auth-security strong {
    color: var(--auth-ink);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 22px;
}

.auth-back svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-inline-form {
    margin: 12px 0 0;
}

.auth-footer {
    display: flex;
    width: 100%;
    max-width: 460px;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 16px;
    margin-top: 26px;
    color: var(--auth-ink-3);
    font-size: 0.75rem;
}

.auth-footer nav {
    display: flex;
    gap: 16px;
}

.auth-footer a {
    color: var(--auth-ink-2);
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--auth-green);
    text-decoration: underline;
}

.auth-body .database-alert {
    border-color: rgba(180, 61, 61, 0.28);
    background: var(--auth-danger-soft);
    color: #5c3a3a;
}

.auth-body .database-alert strong {
    color: var(--auth-danger);
}

/* ---------- Animaciones ---------- */

@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auth-float {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }

    to {
        transform: translate3d(30px, -40px, 0) scale(1.12);
    }
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Responsivo ---------- */

@media (max-width: 1180px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
    }

    .auth-features li:nth-child(3) {
        display: none;
    }
}

@media (max-height: 760px) and (min-width: 961px) {
    .auth-features {
        display: none;
    }
}

@media (max-width: 960px) {
    .auth-shell {
        display: block;
    }

    .auth-hero {
        min-height: auto;
        grid-template-rows: auto;
        gap: 18px;
        padding: 22px 22px 88px;
    }

    .auth-hero-copy h1 {
        margin: 10px 0 8px;
        font-size: clamp(1.7rem, 6vw, 2.3rem);
    }

    .auth-hero-copy > p {
        font-size: 0.9rem;
    }

    .auth-features,
    .auth-hero-bottom,
    .auth-pill {
        display: none;
    }

    .auth-logo-card {
        padding: 9px 13px;
        border-radius: 14px;
    }

    .auth-logo-card img {
        width: 170px;
    }

    .auth-panel {
        min-height: auto;
        justify-content: flex-start;
        margin-top: -64px;
        padding: 0 16px 28px;
        background: transparent;
    }
}

@media (max-width: 480px) {
    .auth-card {
        border-radius: 20px;
    }

    .auth-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-orbs span,
    .auth-features li,
    .auth-card,
    .auth-spinner {
        animation: none;
    }

    .auth-submit,
    .auth-submit::after,
    .auth-features li,
    .auth-logo-card {
        transition: none;
    }
}

/* Instalación como aplicación (PWA): botón que aparece solo si el navegador la ofrece, y aviso para iPhone/iPad. */
.auth-install {
    width: 100%;
    max-width: 460px;
    margin-top: 18px;
    text-align: center;
}

.auth-install-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    background: #fff;
    color: var(--auth-green-dark);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease;
}

.auth-install-button:hover {
    border-color: var(--auth-green);
    background: var(--auth-green-soft);
}

.auth-install-button:focus-visible {
    outline: 3px solid rgba(18, 161, 250, 0.45);
    outline-offset: 2px;
}

.auth-install-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-install-ios {
    margin: 0;
    color: var(--auth-ink-2);
    font-size: 0.82rem;
    line-height: 1.45;
}

/* ---------- Capa minimalista municipal (design-taste-frontend, sector público) ----------
 * Misma sobriedad que la intranet: verde institucional plano en el panel, sin orbes animados, curvas
 * decorativas ni brillo en el botón; tarjeta con borde en vez de sombra; nada se desplaza al pasar el cursor.
 */
.auth-hero {
    background: var(--auth-forest);
}

.auth-hero::before,
.auth-orbs {
    display: none;
}

.auth-card {
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    box-shadow: none;
}

.auth-submit {
    min-height: 50px;
    border-radius: 8px;
    background: var(--auth-green-dark);
    box-shadow: none;
    font-weight: 700;
    transition: background 120ms ease;
}

.auth-submit::after {
    display: none;
}

.auth-submit:hover {
    background: var(--auth-forest);
    box-shadow: none;
    filter: none;
    transform: none;
}

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

.auth-logo-card {
    box-shadow: none;
}

/* Movimiento 2: sin animaciones de entrada (la tarjeta y la lista aparecen ya en su lugar). El giro del botón
 * mientras se envía se mantiene: es estado de carga, no decoración. */
.auth-card,
.auth-features li {
    animation: none;
}

.auth-features li {
    border-color: rgba(255, 255, 255, 0.14);
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.auth-features li:hover {
    transform: none;
}

/* Tipografía y piezas del panel institucional, en versión sobria. */
.auth-kicker {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.auth-kicker::before {
    display: none;
}

.auth-hero h1 {
    font-size: clamp(1.9rem, 3vw, 2.8rem);
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.12;
}

/* Texto con degradado: vetado; la palabra se lee igual que el resto del título. */
.auth-highlight {
    background: none;
    color: inherit;
}

.auth-pill {
    display: none;
}

.auth-features li {
    padding: 12px 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0;
}

.auth-feature-icon {
    width: 28px;
    height: 28px;
    background: none;
    box-shadow: none;
}

.auth-department {
    padding: 0;
    border: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.auth-panel {
    background: #f5f7f5;
}

.auth-greeting {
    padding: 0;
    background: none;
}

.auth-security {
    border: 1px solid var(--auth-line);
    background: var(--auth-field);
}

.auth-heading h2 {
    font-weight: 650;
    letter-spacing: -0.02em;
}

/* ================================================================== */
/* Acceso, versión 2 (frontend-design + design-taste-frontend)        */
/* Lectura: acceso a la intranet municipal para funcionarios y        */
/* contratistas, muchas veces desde un teléfono en terreno; su único  */
/* trabajo es entrar rápido y con la certeza de estar en el sistema   */
/* oficial. Sin promoción: el panel izquierdo identifica (logo,       */
/* nombre, para qué sirve, unidad) y el derecho es el formulario      */
/* sobre papel, sin tarjeta. El único gesto de color es la franja de  */
/* los cinco colores del logo, vertical en el borde del panel (en el  */
/* teléfono, horizontal bajo el encabezado).                          */
/*   Bosque  #033f12  panel        Papel  #ffffff  formulario         */
/*   Tinta   #17231b  texto        Verde  #05661a  acción y foco      */
/*   Franja: #057f14 #aac805 #f8d509 #b8501b #12a1fa (logo)           */
/* ================================================================== */

.auth-shell {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.auth-hero {
    position: relative;
    grid-template-rows: auto 1fr auto;
    gap: 32px;
    padding: clamp(32px, 4vw, 56px);
    padding-right: calc(clamp(32px, 4vw, 56px) + 8px);
    background: var(--auth-forest);
}

/* Franjas con cortes netos, no un degradado: son los colores del logo en el orden de su dibujo. */
.auth-stripe {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(180deg, #057f14 0 24%, #aac805 24% 44%, #f8d509 44% 62%, #b8501b 62% 82%, #12a1fa 82% 100%);
}

.auth-logo-card {
    padding: 12px 16px;
    border-radius: 10px;
    background: #fff;
}

.auth-logo-card img {
    width: clamp(170px, 15vw, 220px);
}

.auth-hero-copy {
    align-self: center;
    max-width: 30rem;
}

.auth-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.auth-hero-copy > p {
    max-width: 40ch;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.02rem;
    line-height: 1.55;
}

.auth-department img {
    width: 44px;
    height: 44px;
}

.auth-department strong {
    letter-spacing: 0;
}

.auth-date {
    color: rgba(255, 255, 255, 0.72);
}

/* ---------- Formulario sobre papel, sin tarjeta ---------- */

.auth-panel {
    background: #fff;
}

.auth-card {
    max-width: 380px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.auth-card::before {
    display: none;
}

.auth-heading {
    margin-bottom: 28px;
}

.auth-heading h2 {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 650;
    letter-spacing: -0.015em;
}

.auth-heading p {
    color: var(--auth-ink-2);
    font-size: 0.97rem;
}

.auth-form {
    gap: 20px;
}

.auth-field label,
.auth-label-row label {
    color: var(--auth-ink);
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-input {
    min-height: 48px;
    border: 1px solid #c3cec6;
    border-radius: 8px;
    background: #fff;
}

.auth-input input {
    padding: 12px 14px;
    font-size: 1rem;
}

.auth-input:focus-within {
    border-color: var(--auth-green-dark);
    box-shadow: 0 0 0 3px rgba(5, 102, 26, 0.18);
}

.auth-eye {
    border-radius: 0 7px 7px 0;
}

.auth-submit {
    min-height: 48px;
    margin-top: 6px;
    font-size: 1rem;
    font-weight: 650;
}

.auth-submit-spaced {
    margin-top: 24px;
}

.auth-note {
    margin: 24px 0 0;
    color: var(--auth-ink-3);
    font-size: 0.86rem;
    line-height: 1.5;
}

.auth-install,
.auth-footer {
    max-width: 380px;
}

/* ---------- Teléfono: encabezado compacto y el formulario de inmediato ---------- */

@media (max-width: 960px) {
    .auth-hero {
        grid-template-rows: auto auto;
        gap: 18px;
        padding: 20px 20px 26px;
    }

    .auth-stripe {
        top: auto;
        left: 0;
        width: auto;
        height: 6px;
        background: linear-gradient(90deg, #057f14 0 24%, #aac805 24% 44%, #f8d509 44% 62%, #b8501b 62% 82%, #12a1fa 82% 100%);
    }

    .auth-hero h1 {
        margin: 0 0 6px;
        font-size: 1.5rem;
    }

    .auth-hero-copy > p {
        font-size: 0.92rem;
    }

    .auth-logo-card img {
        width: 150px;
    }

    .auth-panel {
        margin-top: 0;
        padding: 28px 20px 32px;
        background: #fff;
    }

    .auth-card {
        max-width: none;
    }
}

/* Botón secundario («Cerrar sesión y volver al acceso»): contorno sobre papel. La regla plana de .auth-submit
 * de la capa minimalista le había dejado el fondo verde con texto verde; esta lo devuelve a secundario. */
.auth-submit.auth-submit-secondary {
    border: 1px solid #c3cec6;
    background: #fff;
    color: var(--auth-green-dark);
}

.auth-submit.auth-submit-secondary:hover {
    border-color: var(--auth-green-dark);
    background: var(--auth-green-soft);
}

/* ================================================================== */
/* Movimiento del acceso                                              */
/* Pedido explícito de transiciones: el dial de movimiento sube solo  */
/* en esta pantalla. Criterio de frontend-design: UNA entrada         */
/* orquestada (< 1 s) en vez de efectos sueltos, y movimiento que      */
/* responde a lo que hace la persona. Solo transform y opacity (no     */
/* mueve el diseño ni provoca saltos), curva de salida suave, y todo   */
/* se apaga con «reducir movimiento» del sistema.                      */
/* ================================================================== */

:root {
    --auth-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Profundidad: una luz suave que cae sobre el bosque, en lugar del verde completamente plano. */
.auth-hero {
    background:
        radial-gradient(120% 70% at 0% 0%, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 60%),
        linear-gradient(165deg, #04501a 0%, var(--auth-forest) 55%, #022e0d 100%);
}

/* ---------- Entrada orquestada ---------- */

@keyframes auth-draw-y {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes auth-draw-x {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes auth-enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes auth-appear {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

/* 1. La franja del logo se dibuja de arriba hacia abajo (en el teléfono, de izquierda a derecha). */
.auth-stripe {
    transform-origin: top;
    animation: auth-draw-y 900ms var(--auth-ease) both;
}

/* 2. Identidad: logo, título y descripción, uno tras otro. */
.auth-hero-top,
.auth-hero-copy > *,
.auth-hero-bottom {
    animation: auth-enter 560ms var(--auth-ease) both;
}

.auth-hero-top { animation-delay: 120ms; }
.auth-hero-copy h1 { animation-delay: 220ms; }
.auth-hero-copy > p { animation-delay: 300ms; }
.auth-hero-bottom { animation-delay: 420ms; }

/* 3. El formulario sube suave mientras la identidad termina de aparecer. */
.auth-card {
    animation: auth-enter 620ms var(--auth-ease) 260ms both;
}

.auth-install,
.auth-footer {
    animation: auth-enter 560ms var(--auth-ease) 480ms both;
}

/* ---------- Respuesta a la persona ---------- */

/* El rótulo del campo activo toma el verde de la acción. */
.auth-field label {
    transition: color 160ms ease;
}

.auth-field:focus-within label {
    color: var(--auth-green-dark);
}

.auth-input {
    transition: border-color 160ms ease, box-shadow 220ms var(--auth-ease), background-color 160ms ease;
}

.auth-input:hover:not(:focus-within) {
    border-color: #9fb0a4;
}

/* Botón: cambia de tono al pasar y se hunde 1 px al presionar, como un botón físico. */
.auth-submit {
    transition: background-color 160ms ease, transform 120ms ease, box-shadow 160ms ease;
}

.auth-submit:hover {
    background: #04531a;
}

.auth-submit:active:not(.is-loading) {
    transform: translateY(1px);
}

.auth-submit:focus-visible {
    outline: 3px solid rgba(5, 102, 26, 0.35);
    outline-offset: 3px;
}

/* Mostrar contraseña: los dos ojos se cruzan en vez de cambiar de golpe. */
.auth-eye {
    position: relative;
}

.auth-eye svg,
.auth-eye .icon-hide,
.auth-eye[data-visible="true"] .icon-show,
.auth-eye[data-visible="true"] .icon-hide {
    position: absolute;
    inset: 0;
    display: block;
    margin: auto;
    transition: opacity 180ms ease, transform 240ms var(--auth-ease);
}

.auth-eye .icon-hide,
.auth-eye[data-visible="true"] .icon-show {
    opacity: 0;
    transform: scale(0.7) rotate(-20deg);
}

.auth-eye .icon-show,
.auth-eye[data-visible="true"] .icon-hide {
    opacity: 1;
    transform: none;
}

/* Avisos (Bloq Mayús, errores, mensajes): aparecen con suavidad al mostrarse. */
.auth-capslock:not([hidden]),
.auth-card > .alert {
    animation: auth-appear 240ms var(--auth-ease) both;
}

.auth-link {
    transition: color 160ms ease;
}

/* ---------- Teléfono: la franja es horizontal ---------- */

@media (max-width: 960px) {
    .auth-stripe {
        transform-origin: left;
        animation-name: auth-draw-x;
    }
}

/* ---------- Reducir movimiento: todo aparece ya en su lugar ---------- */

@media (prefers-reduced-motion: reduce) {
    .auth-stripe,
    .auth-hero-top,
    .auth-hero-copy > *,
    .auth-hero-bottom,
    .auth-card,
    .auth-install,
    .auth-footer,
    .auth-capslock:not([hidden]),
    .auth-card > .alert {
        animation: none;
    }

    .auth-field label,
    .auth-input,
    .auth-submit,
    .auth-eye svg,
    .auth-link {
        transition: none;
    }

    .auth-submit:active:not(.is-loading) {
        transform: none;
    }
}
