/**
 * Auth pages (login / recuperar / cambiar clave)
 * Compatible with template light-style and dark-style
 */
:root {
    --auth-ink: #14181f;
    --auth-ink-soft: #1e2530;
    --auth-paper: #eef1f4;
    --auth-paper-card: #ffffff;
    --auth-brand: #dd0000;
    --auth-brand-deep: #a80000;
    --auth-muted: #667085;
    --auth-line: rgba(20, 24, 31, 0.12);
    --auth-font: "Manrope", sans-serif;
    --auth-display: "Fraunces", Georgia, serif;
    --auth-overlay: linear-gradient(155deg, rgba(20, 24, 31, 0.88) 0%, rgba(30, 37, 48, 0.72) 45%, rgba(168, 0, 0, 0.55) 100%);
}

html.dark-style {
    --auth-ink: #e7e3fc;
    --auth-ink-soft: #2b2c40;
    --auth-paper: #25293c;
    --auth-paper-card: #2f3349;
    --auth-muted: #a5a3ae;
    --auth-line: rgba(231, 227, 252, 0.14);
    --auth-overlay: linear-gradient(155deg, rgba(15, 16, 28, 0.92) 0%, rgba(37, 41, 60, 0.78) 48%, rgba(120, 0, 0, 0.62) 100%);
}

html,
body {
    height: 100%;
}

body.auth-page {
    margin: 0;
    font-family: var(--auth-font);
    background: var(--auth-paper);
    color: var(--auth-ink);
    overflow-x: hidden;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
}

.auth-brand {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 4vw, 3.5rem);
    color: #fff;
    overflow: hidden;
    background: var(--auth-ink);
}

.auth-brand-media {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transform: scale(1.02);
    animation: authKenBurns 22s ease-in-out infinite alternate;
}

.auth-brand-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--auth-overlay);
}

.auth-brand-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        -18deg,
        transparent 0,
        transparent 14px,
        rgba(255, 255, 255, 0.03) 14px,
        rgba(255, 255, 255, 0.03) 15px
    );
    opacity: 0.7;
}

.auth-brand-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    opacity: 0;
    animation: authRise 0.7s ease forwards 0.1s;
}

.auth-mark {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.85rem;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    flex-shrink: 0;
    backdrop-filter: blur(6px);
}

.auth-mark svg {
    width: 1.55rem;
    height: auto;
}

.auth-brand-kicker {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.auth-brand-mid {
    max-width: 36rem;
    opacity: 0;
    animation: authRise 0.8s ease forwards 0.28s;
}

.auth-brand-logo {
    display: block;
    width: min(100%, 480px);
    max-width: 100%;
    height: auto;
    margin: 0 0 1.35rem;
    /* El PNG trae fondo negro; se integra con el panel de marca */
    background: #000;
    filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.45));
}

.auth-brand-name {
    font-family: var(--auth-display);
    font-weight: 700;
    font-size: clamp(2.6rem, 5.4vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
    margin: 0 0 1.1rem;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.auth-brand-copy {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.86);
    max-width: 28rem;
}

.auth-brand-bottom {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: authRise 0.8s ease forwards 0.45s;
}

.auth-stat {
    min-width: 7.5rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.auth-stat strong {
    display: block;
    font-family: var(--auth-display);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.auth-stat span {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.68);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: var(--auth-paper);
    position: relative;
}

.auth-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(20, 24, 31, 0.05) 0.8px, transparent 0.8px);
    background-size: 18px 18px;
    opacity: 0.4;
    pointer-events: none;
}

html.dark-style .auth-panel::before {
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 0.8px, transparent 0.8px);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: authRise 0.75s ease forwards 0.2s;
    background: var(--auth-paper-card);
    border: 1px solid var(--auth-line);
    border-radius: 1.25rem;
    padding: clamp(1.35rem, 3vw, 1.85rem);
    box-shadow: 0 18px 40px rgba(20, 24, 31, 0.08);
}

html.dark-style .auth-card {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.auth-card-logo {
    display: none;
    width: min(100%, 280px);
    height: auto;
    margin: 0 auto 1.25rem;
    background: #000;
}

.auth-card-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--auth-brand);
    margin-bottom: 0.85rem;
}

.auth-card-title {
    font-family: var(--auth-display);
    font-size: clamp(1.75rem, 3vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    color: var(--auth-ink);
}

.auth-card-subtitle {
    margin: 0 0 1.75rem;
    color: var(--auth-muted);
    font-size: 0.98rem;
    line-height: 1.5;
}

.auth-card .form-floating > .form-control,
.auth-card .form-floating > .form-select {
    border-radius: 0.85rem;
    border-color: var(--auth-line);
    background: var(--auth-paper-card);
    color: var(--auth-ink);
    min-height: 3.4rem;
}

html.dark-style .auth-card .form-floating > .form-control,
html.dark-style .auth-card .form-floating > .form-select {
    background: var(--auth-paper-card);
    color: var(--auth-ink);
    border-color: var(--auth-line);
}

.auth-card .form-floating > .form-control:focus {
    border-color: var(--auth-brand);
    box-shadow: 0 0 0 0.2rem rgba(221, 0, 0, 0.14);
}

.auth-card .form-floating > label {
    color: var(--auth-muted);
}

/* Evita el "sombra/parche" claro del label flotante en dark mode */
.auth-card .form-floating-outline > label::after,
.auth-card .form-floating-outline > span::after {
    background: var(--auth-paper-card) !important;
}

html.dark-style .auth-card .form-floating-outline > label::after,
html.dark-style .auth-card .form-floating-outline > span::after {
    background: var(--auth-paper-card) !important;
}

html.dark-style .auth-card .form-floating-outline > label,
html.dark-style .auth-card .form-floating-outline > span {
    color: var(--auth-muted);
    background: transparent;
    text-shadow: none;
    box-shadow: none;
}

html.dark-style .auth-card .form-floating > .form-control:-webkit-autofill,
html.dark-style .auth-card .form-floating > .form-control:-webkit-autofill:hover,
html.dark-style .auth-card .form-floating > .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--auth-ink) !important;
    caret-color: var(--auth-ink);
    box-shadow: 0 0 0 1000px var(--auth-paper-card) inset !important;
    transition: background-color 99999s ease-out;
}

.auth-card .input-group-text {
    border-radius: 0 0.85rem 0.85rem 0;
    border-color: var(--auth-line);
    background: var(--auth-paper-card);
    color: var(--auth-muted);
}

html.dark-style .auth-card .input-group-text {
    background: var(--auth-paper-card);
    border-color: var(--auth-line);
    color: var(--auth-muted);
}

.auth-card .form-password-toggle .form-floating > .form-control {
    border-radius: 0.85rem 0 0 0.85rem;
}

.auth-card .input-group-merge:focus-within .input-group-text {
    border-color: var(--auth-brand);
}

.auth-card .btn-auth {
    border: 0;
    border-radius: 0.9rem;
    min-height: 3.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, var(--auth-brand) 0%, var(--auth-brand-deep) 100%);
    box-shadow: 0 10px 24px rgba(221, 0, 0, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-card .btn-auth:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 14px 28px rgba(221, 0, 0, 0.28);
    background: linear-gradient(135deg, var(--auth-brand) 0%, var(--auth-brand-deep) 100%);
}

.auth-links {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.35rem;
}

.auth-links a,
.auth-back {
    color: var(--auth-ink);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.auth-links a:hover,
.auth-back:hover {
    color: var(--auth-brand);
    border-bottom-color: rgba(221, 0, 0, 0.35);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin-top: 1.15rem;
}

.auth-footer-note {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--auth-muted);
    text-align: center;
}

@keyframes authRise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authKenBurns {
    from { transform: scale(1.02) translate3d(0, 0, 0); }
    to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
}

@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        min-height: 40vh;
        padding: 1.5rem 1.35rem 2rem;
    }

    .auth-brand-name {
        font-size: clamp(2.1rem, 9vw, 3rem);
    }

    .auth-brand-logo {
        width: min(100%, 320px);
    }

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

    .auth-panel {
        padding: 1.5rem 1.1rem 2.25rem;
    }

    .auth-card {
        box-shadow: none;
        border: 0;
        background: transparent;
        padding: 0;
    }

    .auth-card-logo {
        display: block;
    }

    /* En mobile el card es transparente: el recorte del label usa el paper */
    .auth-card .form-floating > .form-control,
    .auth-card .form-floating > .form-select,
    .auth-card .input-group-text,
    .auth-card .form-floating-outline > label::after,
    .auth-card .form-floating-outline > span::after {
        background: var(--auth-paper) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-brand-media,
    .auth-brand-top,
    .auth-brand-mid,
    .auth-brand-bottom,
    .auth-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
