/**
 * ============================================================================
 * HiBIT Colombia — Enterprise Stylesheet (inicio.css)
 * ============================================================================
 * v3 — "Playful Enterprise"
 * Base SaaS Premium Light con glassmorphism (azul celeste corporativo) +
 * una capa lúdica pensada para niños: mascota robot "Bit", íconos STEM
 * flotantes con parallax, manchas de color vivas, titular tipo máquina de
 * escribir, datos curiosos, confeti y micro-interacciones.
 *
 * Responsive afinado para teléfonos de 6.7" como el Samsung Galaxy S25 FE
 * (viewport CSS ≈ 384 × 832), con soporte de safe-areas (cámara perforada),
 * unidades dvh, objetivos táctiles ≥ 44px y modo horizontal.
 *
 * Los nombres de variables (--brand-purple*, --bg-deep*, --text-on-dark*)
 * se conservan por compatibilidad; solo sus valores son azul celeste.
 * ============================================================================
 */

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
    color-scheme: only light;
    /* Marca */
    --brand-purple: #0EA5E9;
    --brand-purple-light: #38BDF8;
    --brand-purple-dark: #0284C7;
    --brand-purple-deep: #075985;
    --brand-purple-glow: rgba(14, 165, 233, 0.38);
    --brand-purple-glow-soft: rgba(14, 165, 233, 0.14);
    /* Acentos (LEDs + paleta lúdica) */
    --color-lime: #10B981;
    --color-yellow: #F59E0B;
    --color-red: #EF4444;
    --c-violet: #8B5CF6;
    --c-coral: #FB7185;
    /* Lienzo */
    --bg-deep: #F5FAFF;
    --bg-deep-2: #EAF4FD;
    --bg-deep-3: #DCEEFC;
    /* Cristal */
    --glass-fill: rgba(255, 255, 255, 0.55);
    --glass-fill-strong: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(14, 116, 178, 0.14);
    --glass-border-strong: rgba(14, 165, 233, 0.38);
    --glass-input-bg: rgba(255, 255, 255, 0.6);
    --glass-input-bg-hover: rgba(255, 255, 255, 0.82);
    --glass-input-bg-focus: rgba(255, 255, 255, 0.98);
    /* Modal */
    --c-surface: #FFFFFF;
    --c-bg-app: #F8FAFC;
    --c-border: #E2E8F0;
    --c-border-focus: #CBD5E1;
    /* Texto */
    --text-on-dark: #0B1B33;
    --text-on-dark-muted: rgba(15, 40, 71, 0.66);
    --text-on-dark-faint: rgba(15, 40, 71, 0.40);
    --text-main: #0F172A;
    --text-muted: #64748B;
    /* Tipografía */
    --font-ui: 'Red Hat Text', -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Red Hat Display', 'Red Hat Text', sans-serif;
    --font-fun: 'Baloo 2', 'Red Hat Text', sans-serif;
    --font-script: cursive;
    --font-mono: 'Red Hat Mono', ui-monospace, monospace;
    /* Sombras */
    --shadow-sm: 0 2px 10px rgba(15, 60, 110, 0.10);
    --shadow-glass: 0 30px 70px -18px rgba(14, 116, 178, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
    --shadow-card-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.16);
    --shadow-button: 0 12px 26px -8px rgba(14, 165, 233, 0.45);
    --shadow-button-hover: 0 18px 34px -8px rgba(14, 165, 233, 0.55);
    /* Movimiento */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast: 0.3s;
    --dur-base: 0.45s;
    --dur-slow: 0.6s;
    /* Safe areas (cámara perforada / barra de gestos) */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html, body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-ui);
    background-color: var(--bg-deep);
    color: var(--text-on-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

.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;
}

*:focus-visible {
    outline: 3px solid var(--brand-purple-light);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background-color: var(--brand-purple);
    color: white;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   4. ESCENARIO DE FONDO
   ========================================================================== */
.hero-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--bg-deep);
}

.hero-bg__fallback {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 14% 18%, rgba(56, 189, 248, 0.30), transparent 45%), radial-gradient(circle at 88% 8%, rgba(14, 165, 233, 0.28), transparent 50%), radial-gradient(circle at 50% 92%, rgba(2, 132, 199, 0.20), transparent 55%), linear-gradient(160deg, #F5FAFF 0%, #EAF4FD 55%, #DCEEFC 100%);
}

.hero-bg__image {
    position: absolute;
    inset: -20px;
    background-image: url('image.png');
    background-size: cover;
    background-position: center;
    filter: blur(4px) brightness(0.55) saturate(1.15) contrast(1.05);
    transform: scale(1.06);
    animation: driftZoom 32s linear infinite alternate;
    will-change: transform;
}

.hero-bg__grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(14, 165, 233, 0.09) 1px, transparent 1px), linear-gradient(90deg, rgba(14, 165, 233, 0.09) 1px, transparent 1px);
    background-size: 42px 42px;
    mix-blend-mode: overlay;
    opacity: 0.5;
}

.hero-bg__gradient-dark {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(245, 250, 255, 0.55) 0%, rgba(245, 250, 255, 0.86) 45%, rgba(245, 250, 255, 0.97) 100%);
}

/* Manchas de color (degradados radiales: sin filtros costosos en móvil) */
.hero-bg__blobs {
    position: absolute;
    inset: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

.blob--1 {
    width: 46vmax;
    height: 46vmax;
    top: -14vmax;
    left: -10vmax;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.32), transparent 65%);
    animation: blobMove 20s ease-in-out infinite alternate;
}

.blob--2 {
    width: 38vmax;
    height: 38vmax;
    bottom: -14vmax;
    left: 26%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.18), transparent 65%);
    animation: blobMove 24s ease-in-out -6s infinite alternate-reverse;
}

.blob--3 {
    width: 34vmax;
    height: 34vmax;
    top: 6%;
    right: -12vmax;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.14), transparent 65%);
    animation: blobMove 22s ease-in-out -3s infinite alternate;
}

/* Íconos STEM flotantes */
.hero-bg__floaters {
    position: absolute;
    inset: 0;
    --px: 0;
    --py: 0;
}

.floater {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: calc(58px * var(--s, 1));
    height: calc(58px * var(--s, 1));
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 30px -14px rgba(14, 116, 178, 0.45), inset 0 0 0 1px rgba(14, 165, 233, 0.06);
    color: var(--c);
    opacity: 0.9;
    transform: translate3d(calc(var(--px) * var(--d) * -36px), calc(var(--py) * var(--d) * -36px), 0) rotate(var(--r, 0deg));
    will-change: transform;
}

    .floater svg {
        width: 52%;
        height: 52%;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        animation: floatBob var(--t, 7s) ease-in-out infinite alternate;
    }

.floater--spin svg {
    animation: spinSlow 16s linear infinite;
}

.hero-bg__particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.9;
}

/* ==========================================================================
   5. LAYOUT PRINCIPAL + PANEL DE MARCA
   ========================================================================== */
.viewport {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

#page {
    transition: opacity 0.9s var(--ease-out);
}

    #page[aria-hidden="true"] {
        opacity: 0;
        pointer-events: none;
    }

.hero-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 5vw;
    padding-left: max(5vw, var(--safe-left));
    background-color: transparent;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: min(620px, 100%);
    min-width: 0;
}

.hero-logo-wrapper,
.hibit-logo-massive {
    max-width: 100%;
    min-width: 0;
}

/* Aparición escalonada al entrar a la página */
#page:not([aria-hidden]) .hero-eyebrow { animation: slideUpFade var(--dur-slow) var(--ease-out) 0.05s backwards; }
#page:not([aria-hidden]) .hero-logo-wrapper { animation: logoPop 0.9s var(--ease-spring) 0.12s backwards; }
#page:not([aria-hidden]) .hero-divider { animation: dividerGrow var(--dur-slow) var(--ease-out) 0.3s backwards; }
#page:not([aria-hidden]) .hero-heading { animation: slideUpFade var(--dur-slow) var(--ease-out) 0.34s backwards; }
#page:not([aria-hidden]) .hero-description { animation: slideUpFade var(--dur-slow) var(--ease-out) 0.42s backwards; }
#page:not([aria-hidden]) .hero-features li { animation: chipIn 0.6s var(--ease-spring) backwards; }
#page:not([aria-hidden]) .hero-features li:nth-child(1) { animation-delay: 0.5s; }
#page:not([aria-hidden]) .hero-features li:nth-child(2) { animation-delay: 0.58s; }
#page:not([aria-hidden]) .hero-features li:nth-child(3) { animation-delay: 0.66s; }
#page:not([aria-hidden]) .hero-features li:nth-child(4) { animation-delay: 0.74s; }
#page:not([aria-hidden]) .fun-fact { animation: slideUpFade var(--dur-slow) var(--ease-out) 0.82s backwards; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-on-dark-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1.6rem;
}

.hero-eyebrow__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-lime);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulseRing 2s infinite;
}

/* Logotipo */
.hero-logo-wrapper {
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
}

.hibit-logo-massive {
    display: flex;
    align-items: baseline;
    font-size: clamp(4.5rem, 7.5vw, 7rem);
    line-height: 1;
    letter-spacing: -2px;
}

.custom-logo {
    height: clamp(4.5rem, 7.5vw, 7rem);
    width: auto;
    max-width: 100%;
    object-fit: contain;
    /* Si la imagen no carga, el texto alternativo no rompe el diseño */
    font-size: 1rem;
    font-family: var(--font-display);
    color: var(--text-on-dark);
    /* Vuelve invisibles los píxeles 100% blancos del PNG sobre el fondo claro */
    mix-blend-mode: multiply;
}

.logo-text-hi {
    font-family: var(--font-script);
    color: var(--brand-purple-light);
    padding-right: 4px;
    filter: drop-shadow(0 4px 18px var(--brand-purple-glow));
}

.logo-text-bit {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--text-on-dark);
}

.logo-indicators-massive {
    display: flex;
    gap: 8px;
    margin-left: 12px;
    transform: translateY(-8px);
}

    .logo-indicators-massive .indicator-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        box-shadow: 0 0 8px currentColor;
        animation: ledBlink 3s infinite;
    }

        .logo-indicators-massive .indicator-dot:nth-child(2) { animation-delay: 0.4s; }
        .logo-indicators-massive .indicator-dot:nth-child(3) { animation-delay: 0.8s; }

.dot-green { background: var(--color-lime); color: var(--color-lime); }
.dot-yellow { background: var(--color-yellow); color: var(--color-yellow); }
.dot-red { background: var(--color-red); color: var(--color-red); }

.hero-divider {
    width: 80px;
    height: 6px;
    background: linear-gradient(90deg, var(--brand-purple), var(--color-lime), var(--color-yellow));
    background-size: 200% 100%;
    border-radius: 3px;
    margin-bottom: 2rem;
    box-shadow: 0 0 16px var(--brand-purple-glow-soft);
    transform-origin: left center;
    animation: gradientSlide 4s ease-in-out infinite alternate;
}

.hero-heading {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 3.8vw, 3.8rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: var(--text-on-dark);
    margin-bottom: 1.25rem;
    text-wrap: balance;
}

.hero-heading__typed {
    display: inline-flex;
    align-items: center;
    min-height: 1.1em;
    white-space: nowrap;
}

.hero-heading--accent {
    background: linear-gradient(100deg, var(--brand-purple-light), var(--brand-purple) 50%, var(--c-violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-bottom: 0.06em;
}

.type-caret {
    display: inline-block;
    width: 0.07em;
    height: 0.9em;
    margin-left: 0.06em;
    border-radius: 2px;
    background: var(--brand-purple);
    animation: caretBlink 1s steps(1) infinite;
}

.hero-description {
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--text-on-dark-muted);
    font-weight: 400;
    margin-bottom: 2rem;
    max-width: 480px;
}

/* Chips de identidad */
.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    list-style: none;
    margin-bottom: 1.75rem;
}

    .hero-features li {
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        padding: 0.45rem 0.95rem 0.45rem 0.45rem;
        background: var(--glass-fill);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        color: var(--text-on-dark);
        font-size: 0.85rem;
        font-weight: 600;
        white-space: nowrap;
        transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-out);
    }

.chip-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: var(--chip-c);
    background: rgba(14, 165, 233, 0.12);
    background: color-mix(in srgb, var(--chip-c) 15%, white);
}

@media (hover: hover) {
    .hero-features li:hover {
        background: var(--glass-fill-strong);
        border-color: var(--chip-c);
        transform: translateY(-3px);
        box-shadow: 0 10px 22px -12px var(--chip-c);
    }

        .hero-features li:hover .chip-icon {
            animation: wiggle 0.5s ease-in-out;
        }
}

/* Dato curioso */
.fun-fact {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    width: 100%;
    max-width: 580px;
    padding: 1.3rem 1.4rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 251, 235, 0.85));
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 18px 40px -22px rgba(245, 158, 11, 0.55), var(--shadow-sm);
}

.fun-fact__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    font-size: 1.65rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    animation: bulbGlow 2.4s ease-in-out infinite;
}

.fun-fact__body {
    flex: 1;
    min-width: 0;
}

.fun-fact__label {
    display: block;
    font-family: var(--font-fun);
    font-weight: 700;
    font-size: 1.1rem;
    color: #B45309;
    margin-bottom: 0.3rem;
}

.fun-fact__text {
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--text-on-dark);
    min-height: 3.1em;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

    .fun-fact__text.is-leaving {
        opacity: 0;
        transform: translateY(6px);
    }

.fun-fact__dots {
    display: flex;
    gap: 6px;
    margin-top: 0.75rem;
}

    .fun-fact__dots span {
        width: 8px;
        height: 8px;
        border-radius: 99px;
        background: rgba(14, 116, 178, 0.2);
        transition: width var(--dur-fast) var(--ease-out), background var(--dur-fast);
    }

        .fun-fact__dots span.is-active {
            width: 24px;
            background: var(--color-yellow);
        }

.fun-fact__next {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    align-self: center;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--brand-purple-dark);
    cursor: pointer;
    transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast);
}

    .fun-fact__next:active {
        transform: scale(0.9);
    }

@media (hover: hover) {
    .fun-fact__next:hover {
        background: var(--brand-purple);
        color: white;
        transform: translateX(2px);
    }
}

/* ==========================================================================
   6. TARJETA DE ACCESO + MASCOTA
   ========================================================================== */
.auth-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7rem 3rem 3rem 1.5rem;
    padding-right: max(3rem, var(--safe-right));
    background-color: transparent;
}

.elegant-card {
    --rx: 0deg;
    --ry: 0deg;
    --mx: 50%;
    --my: 0%;
    position: relative;
    width: 100%;
    max-width: 560px;
    background: linear-gradient(165deg, var(--glass-fill-strong), var(--glass-fill));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3.5rem 3.25rem 2.5rem;
    box-shadow: var(--shadow-glass);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    transform: perspective(1200px) rotateX(var(--rx)) rotateY(var(--ry));
    transition: transform 0.5s var(--ease-out), border-color var(--dur-fast);
}

#page:not([aria-hidden]) .elegant-card {
    animation: cardEnter 0.9s var(--ease-spring) 0.15s backwards;
}

/* Luz que sigue al cursor sobre el cristal */
.elegant-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(380px circle at var(--mx) var(--my), rgba(56, 189, 248, 0.16), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
    pointer-events: none;
}

.elegant-card.is-hovered::before {
    opacity: 1;
}

/* Destello de luz que recorre el borde de la tarjeta */
.elegant-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(from var(--angle), transparent 0 72%, rgba(56, 189, 248, 0.9) 80%, rgba(16, 185, 129, 0.7) 86%, transparent 92%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    animation: borderSpin 6s linear infinite;
    pointer-events: none;
}

.card-header,
.auth-form,
.card-footer {
    position: relative;
}

/* --- Mascota "Bit" --- */
.mascot {
    --mascot-w: 140px;
    position: absolute;
    left: 50%;
    top: calc(var(--mascot-w) * -0.686);
    width: var(--mascot-w);
    aspect-ratio: 140 / 112;
    transform: translateX(-50%);
    z-index: 3;
    cursor: pointer;
    filter: drop-shadow(0 10px 14px rgba(14, 116, 178, 0.2));
    -webkit-user-select: none;
    user-select: none;
}

#page:not([aria-hidden]) .mascot {
    animation: mascotPeek 0.9s var(--ease-spring) 0.6s backwards;
}

.mascot__svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    transform-origin: 50% 90%;
}

.mascot__head {
    animation: mascotBob 3.2s ease-in-out infinite;
}

.mascot__bulb {
    fill: var(--color-yellow);
    transform-box: fill-box;
    transform-origin: center;
    animation: bulbPulse 1.6s ease-in-out infinite;
    transition: fill var(--dur-fast);
}

.mascot.is-typing .mascot__bulb {
    fill: var(--brand-purple-light);
    animation-duration: 0.35s;
}

.mascot.is-thinking .mascot__bulb {
    fill: var(--c-violet);
    animation-duration: 0.5s;
}

.mascot.is-happy .mascot__bulb { fill: var(--color-lime); }
.mascot.is-sad .mascot__bulb { fill: var(--color-red); }

.mascot__eye {
    fill: #38BDF8;
    filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.9));
}

.mascot__eye-set {
    transition: opacity 0.2s ease;
}

.mascot__eye-set--normal {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.12s ease, opacity 0.2s ease;
}

.mascot.is-blinking .mascot__eye-set--normal {
    transform: scaleY(0.1);
}

.mascot__eye-set--happy path,
.mascot__eye-set--sad path {
    fill: none;
    stroke: #38BDF8;
    stroke-width: 3;
    stroke-linecap: round;
}

.mascot__eye-set--happy,
.mascot__eye-set--sad {
    opacity: 0;
}

.mascot.is-happy .mascot__eye-set--normal,
.mascot.is-sad .mascot__eye-set--normal {
    opacity: 0;
}

.mascot.is-happy .mascot__eye-set--happy,
.mascot.is-sad .mascot__eye-set--sad {
    opacity: 1;
}

.mascot__mouth {
    fill: none;
    stroke: #38BDF8;
    stroke-width: 2.5;
    stroke-linecap: round;
}

.mascot__cheek {
    fill: var(--c-coral);
    opacity: 0.35;
    transition: opacity var(--dur-fast);
}

.mascot.is-happy .mascot__cheek,
.mascot.is-shy .mascot__cheek {
    opacity: 0.85;
}

.mascot__hand {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.45s var(--ease-spring);
}

/* Se tapa los ojos cuando escribes la clave */
.mascot.is-shy .mascot__hand--left { transform: translate(12px, -45px) rotate(-10deg); }
.mascot.is-shy .mascot__hand--right { transform: translate(-12px, -45px) rotate(10deg); }
/* …y espía un poquito cuando la muestras */
.mascot.is-shy.is-peeking .mascot__hand--right { transform: translate(-2px, -22px) rotate(24deg); }

.mascot.is-jumping .mascot__svg { animation: mascotJump 0.7s var(--ease-out); }
.mascot.is-shaking .mascot__svg { animation: mascotShake 0.5s ease-in-out; }

/* Globo de diálogo */
.mascot-bubble {
    position: absolute;
    z-index: 4;
    bottom: calc(100% + 30px);
    left: calc(50% + 60px);
    width: max-content;
    max-width: min(210px, calc(50% - 40px));
    padding: 0.55rem 0.8rem;
    background: #FFFFFF;
    border: 1.5px solid rgba(14, 165, 233, 0.35);
    border-radius: 14px 14px 14px 4px;
    box-shadow: 0 12px 28px -10px rgba(14, 116, 178, 0.35);
    font-family: var(--font-fun);
    font-weight: 500;
    font-size: 0.86rem;
    line-height: 1.3;
    color: var(--text-on-dark);
    opacity: 0;
    transform: translateY(6px) scale(0.85);
    transform-origin: left bottom;
    transition: opacity 0.25s var(--ease-out), transform 0.35s var(--ease-spring);
    pointer-events: none;
}

    .mascot-bubble::before {
        content: '';
        position: absolute;
        left: -7px;
        bottom: 9px;
        width: 11px;
        height: 11px;
        background: #FFFFFF;
        border-left: 1.5px solid rgba(14, 165, 233, 0.35);
        border-bottom: 1.5px solid rgba(14, 165, 233, 0.35);
        transform: rotate(45deg);
    }

    .mascot-bubble.is-visible {
        opacity: 1;
        transform: none;
    }

/* Encabezado */
.card-header {
    margin-bottom: 2rem;
}

.card-header__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background: var(--brand-purple-glow-soft);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: var(--brand-purple-dark);
    border-radius: 8px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 1.25rem;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-on-dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.wave {
    display: inline-block;
    transform-origin: 70% 70%;
    animation: wave 2.6s ease-in-out 1.4s infinite;
}

.card-subtitle {
    font-size: 1rem;
    color: var(--text-on-dark-muted);
    line-height: 1.5;
}

/* ==========================================================================
   7. FORMULARIO
   ========================================================================== */
.auth-form {
    display: flex;
    flex-direction: column;
}

.field-group {
    margin-bottom: 1.6rem;
    position: relative;
}

.field-wrapper {
    position: relative;
}

    .field-wrapper input {
        width: 100%;
        min-height: 58px;
        padding: 1.5rem 3rem 0.6rem 3rem;
        background: var(--glass-input-bg);
        border: 1.5px solid var(--glass-border);
        border-radius: 14px;
        font-family: var(--font-ui);
        font-size: 1rem; /* 16px: evita el zoom automático en móviles */
        font-weight: 500;
        color: var(--text-on-dark);
        transition: all var(--dur-fast) var(--ease-out);
        -webkit-appearance: none;
        appearance: none;
    }

        .field-wrapper input::placeholder {
            color: transparent;
        }

@media (hover: hover) {
    .field-wrapper input:hover {
        background: var(--glass-input-bg-hover);
        border-color: var(--glass-border-strong);
    }
}

.field-wrapper input:focus {
    background: var(--glass-input-bg-focus);
    border-color: var(--brand-purple-light);
    box-shadow: 0 0 0 4px var(--brand-purple-glow-soft), 0 8px 20px -8px var(--brand-purple-glow);
    outline: none;
}

.field-wrapper input:disabled {
    opacity: 0.7;
}

.field-wrapper input:-webkit-autofill,
.field-wrapper input:-webkit-autofill:hover,
.field-wrapper input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-on-dark);
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.95) inset;
    transition: background-color 9999s ease-in-out 0s;
}

.label-icon {
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-on-dark-faint);
    transition: color var(--dur-fast) var(--ease-out);
}

.field-wrapper input:focus ~ label .label-icon {
    color: var(--brand-purple-light);
}

.field-wrapper label {
    position: absolute;
    left: 3rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-on-dark-faint);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.25s var(--ease-out);
    transform-origin: left top;
}

.field-wrapper input:focus ~ label,
.field-wrapper input:not(:placeholder-shown) ~ label {
    transform: translateY(-130%) scale(0.75);
    color: var(--brand-purple-dark);
    font-weight: 600;
}

/* Línea de energía inferior al enfocar */
.field-line {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--brand-purple), var(--color-lime));
    transform: scaleX(0);
    transition: transform 0.45s var(--ease-out);
    pointer-events: none;
}

.field-wrapper input:focus ~ .field-line {
    transform: scaleX(1);
}

/* Check verde de validación en vivo */
.field-valid {
    position: absolute;
    right: 1rem;
    top: 50%;
    width: 24px;
    height: 24px;
    margin-top: -12px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-lime);
    color: white;
    transform: scale(0);
    transition: transform 0.4s var(--ease-spring);
    pointer-events: none;
}

.field-group.is-valid .field-valid {
    transform: scale(1);
}

.field-group.is-valid input {
    border-color: rgba(16, 185, 129, 0.5);
}

/* Errores */
.field-error {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #DC2626;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all var(--dur-fast) var(--ease-out);
}

    .field-error:empty {
        margin-top: 0;
    }

.field-group.has-error .field-error {
    opacity: 1;
    transform: translateY(0);
}

.field-group.has-error input {
    border-color: var(--color-red);
    background: rgba(239, 68, 68, 0.08);
}

.field-group.has-error .label-icon {
    color: #DC2626;
}

/* Aviso de Bloq Mayús */
.field-hint {
    display: none;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #B45309;
}

    .field-hint.is-visible {
        display: flex;
        animation: slideUpFade 0.3s var(--ease-out);
    }

    .field-hint::before {
        content: '⇪';
        display: grid;
        place-items: center;
        width: 18px;
        height: 18px;
        border-radius: 5px;
        background: #FEF3C7;
        font-size: 0.75rem;
    }

/* Toggle contraseña (objetivo táctil de 44px) */
.field-toggle-pw {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    display: grid;
    place-items: center;
    background: none;
    border: none;
    color: var(--text-on-dark-faint);
    cursor: pointer;
    border-radius: 10px;
    transition: color var(--dur-fast), background var(--dur-fast);
}

@media (hover: hover) {
    .field-toggle-pw:hover {
        color: var(--brand-purple-light);
        background: var(--glass-fill);
    }
}

/* Opciones */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.9rem;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.remember-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    cursor: pointer;
}

/* Visualmente oculto pero accesible con teclado */
.remember-checkbox {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.remember-custom {
    width: 22px;
    height: 22px;
    border: 1.5px solid var(--glass-border-strong);
    background: var(--glass-input-bg);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--dur-fast) var(--ease-spring);
}

.remember-checkbox:focus-visible + .remember-custom {
    outline: 3px solid var(--brand-purple-light);
    outline-offset: 2px;
}

.remember-checkbox:checked + .remember-custom {
    background: var(--brand-purple);
    border-color: var(--brand-purple);
    transform: scale(1.08);
}

    .remember-checkbox:checked + .remember-custom::after {
        content: '';
        width: 5px;
        height: 10px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
        margin-bottom: 2px;
        animation: checkPop 0.3s var(--ease-spring);
    }

.remember-text {
    font-size: 0.9rem;
    color: var(--text-on-dark-muted);
    font-weight: 500;
}

.reset-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.9rem;
    color: var(--brand-purple-dark);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--dur-fast);
}

@media (hover: hover) {
    .reset-link:hover {
        color: var(--text-on-dark);
        text-decoration: underline;
    }
}

/* ==========================================================================
   8. BOTÓN PRINCIPAL
   ========================================================================== */
.btn-auth {
    position: relative;
    width: 100%;
    min-height: 58px;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--brand-purple) 0%, var(--brand-purple-dark) 60%, var(--brand-purple-deep) 100%);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 16px;
    color: white;
    font-family: var(--font-ui);
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    overflow: hidden;
    box-shadow: var(--shadow-button);
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out);
    touch-action: manipulation;
}

.btn-auth__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: shimmer 4.5s ease-in-out 2s infinite;
}

@media (hover: hover) {
    .btn-auth:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-button-hover);
        filter: brightness(1.05);
    }

        .btn-auth:hover .btn-auth__icon {
            transform: translateX(5px);
        }
}

.btn-auth:active {
    transform: translateY(0) scale(0.985);
    box-shadow: 0 4px 14px -4px rgba(14, 165, 233, 0.5);
}

.btn-auth:disabled {
    cursor: progress;
}

.btn-auth__content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.btn-auth__text,
.btn-auth__icon {
    transition: opacity var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}

.btn-auth__spinner {
    position: absolute;
    opacity: 0;
    transform: scale(0.5);
    animation: spin 1s linear infinite;
    transition: all var(--dur-fast);
}

.btn-auth.is-loading .btn-auth__text,
.btn-auth.is-loading .btn-auth__icon {
    opacity: 0;
}

.btn-auth.is-loading .btn-auth__spinner {
    opacity: 1;
    transform: scale(1);
}

/* Onda al tocar (feedback táctil) */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transform: scale(0);
    animation: ripple 0.65s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}

.card-footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-on-dark-faint);
    font-size: 0.82rem;
}

/* Accesos de prueba */
.demo-access {
    position: relative;
    margin-top: 1.4rem;
    padding: 0.9rem;
    border-radius: 16px;
    border: 1.5px dashed rgba(14, 165, 233, 0.35);
    background: rgba(240, 249, 255, 0.7);
}
.demo-access__label {
    position: absolute;
    top: -0.62rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 0.6rem;
    background: linear-gradient(#fff, #F5FAFF);
    border-radius: 99px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand-purple-dark);
    white-space: nowrap;
}
.demo-access__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.demo-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 56px;
    padding: 0.5rem 0.7rem;
    border-radius: 14px;
    border: 1.5px solid var(--glass-border);
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: transform 0.25s var(--ease-spring), border-color 0.2s, box-shadow 0.2s;
}
.demo-btn:hover { transform: translateY(-2px); border-color: var(--brand-purple-light); box-shadow: 0 10px 20px -12px rgba(14, 165, 233, 0.7); }
.demo-btn:active { transform: scale(0.97); }
.demo-btn:disabled { opacity: 0.55; cursor: progress; transform: none; }
.demo-btn[style*="--dc"]:hover { border-color: var(--dc); box-shadow: 0 10px 20px -12px var(--dc); }
.demo-btn__icon--logo { background: #fff !important; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--dc) 35%, white); }
.demo-btn__icon--logo img { width: 32px; height: 32px; object-fit: contain; }
.demo-btn__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #E0F2FE, #BAE6FD);
}
.demo-btn--student .demo-btn__icon { background: linear-gradient(135deg, #FEF3C7, #FDE68A); }
.demo-btn__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.demo-btn__txt strong { font-family: var(--font-fun); font-weight: 600; font-size: 0.95rem; color: var(--text-on-dark); }
.demo-btn__txt small { font-size: 0.7rem; color: var(--text-on-dark-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Acceso de administración: ocupa toda la fila, tono ejecutivo */
.demo-btn--admin { grid-column: 1 / -1; background: linear-gradient(120deg, #0B1B33, #1E3A5F); border-color: #1E3A5F; }
.demo-btn--admin .demo-btn__icon { background: rgba(255, 255, 255, 0.12) !important; color: #7DD3FC; }
.demo-btn--admin .demo-btn__txt strong { color: #fff; }
.demo-btn--admin .demo-btn__txt small { color: rgba(226, 238, 255, 0.72); }
.demo-btn--admin:hover { border-color: #38BDF8; box-shadow: 0 12px 24px -14px rgba(11, 27, 51, 0.9); }
.demo-btn__tag { margin-left: auto; padding: 0.15rem 0.5rem; border-radius: 999px; font-family: var(--font-mono); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #0B1B33; background: #7DD3FC; }
.demo-access__hint { margin-top: 0.6rem; text-align: center; font-size: 0.76rem; color: var(--text-on-dark-muted); }
.demo-access__hint b { font-family: var(--font-mono); color: var(--brand-purple-dark); }

@media (max-width: 360px) {
    .demo-access__btns { grid-template-columns: 1fr; }
}

/* Confeti de éxito (canvas creado por JS) */
.confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10001;
}

/* ==========================================================================
   9. MODAL DEL SISTEMA
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 32, 56, 0.45);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-base), visibility var(--dur-base);
    padding: 1.5rem;
    padding-bottom: max(1.5rem, var(--safe-bottom));
}

    .modal-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.modal-panel {
    background: var(--c-surface);
    border-radius: 22px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-card-modal);
    transform: scale(0.92) translateY(10px);
    transition: transform var(--dur-base) var(--ease-spring);
}

.modal-overlay.active .modal-panel {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.modal-header__icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-overlay.active .modal-header__icon {
    animation: iconPop 0.6s var(--ease-spring) 0.1s backwards;
}

.modal-header__icon.is-success { background: #ECFDF5; }
.modal-header__icon.is-error { background: #FEF2F2; }
.modal-header__icon.is-info { background: #E0F2FE; }

.modal-header__eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-status-line {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: var(--c-bg-app);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.modal-status-code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
}

.modal-status-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.modal-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.btn-modal-close {
    width: 100%;
    min-height: 52px;
    padding: 1rem;
    background: var(--c-surface);
    border: 2px solid var(--c-border-focus);
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}

@media (hover: hover) {
    .btn-modal-close:hover {
        border-color: var(--brand-purple);
        color: var(--brand-purple);
        transform: translateY(-1px);
    }
}

/* ==========================================================================
   10. KEYFRAMES
   ========================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinSlow { to { transform: rotate(360deg); } }

@keyframes pulseRing {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

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

@keyframes logoPop {
    0% { opacity: 0; transform: scale(0.85) translateY(16px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes dividerGrow {
    from { opacity: 0; transform: scaleX(0); }
    to { opacity: 1; transform: scaleX(1); }
}

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

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(34px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes driftZoom {
    0% { transform: scale(1.06) translate(0, 0); }
    100% { transform: scale(1.12) translate(-1.5%, 1.5%); }
}

@keyframes blobMove {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(6%, 8%) scale(1.08); }
    100% { transform: translate(-4%, 4%) scale(0.96); }
}

@keyframes floatBob {
    0% { transform: translateY(-4px) rotate(-6deg); }
    100% { transform: translateY(5px) rotate(6deg); }
}

@keyframes gradientSlide {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

@keyframes ledBlink {
    0%, 88%, 100% { opacity: 1; }
    92% { opacity: 0.35; }
}

@keyframes caretBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-12deg) scale(1.1); }
    75% { transform: rotate(12deg) scale(1.1); }
}

@keyframes bulbGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.0); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.15); }
}

@keyframes borderSpin { to { --angle: 360deg; } }

@keyframes wave {
    0%, 60%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(16deg); }
    20%, 40% { transform: rotate(-8deg); }
}

@keyframes mascotPeek {
    from { opacity: 0; transform: translateX(-50%) translateY(46px) scale(0.8); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes mascotBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2.5px); }
}

@keyframes mascotJump {
    0%, 100% { transform: translateY(0) rotate(0); }
    30% { transform: translateY(-16px) rotate(-5deg); }
    55% { transform: translateY(0) rotate(0); }
    72% { transform: translateY(-6px) rotate(3deg); }
}

@keyframes mascotShake {
    0%, 100% { transform: translateX(0) rotate(0); }
    20% { transform: translateX(-6px) rotate(-4deg); }
    40% { transform: translateX(6px) rotate(4deg); }
    60% { transform: translateX(-4px) rotate(-2deg); }
    80% { transform: translateX(4px) rotate(2deg); }
}

@keyframes bulbPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.18); opacity: 0.75; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    35%, 100% { transform: translateX(100%); }
}

@keyframes ripple {
    to { transform: scale(2.6); opacity: 0; }
}

@keyframes checkPop {
    from { transform: rotate(45deg) scale(0); }
    to { transform: rotate(45deg) scale(1); }
}

@keyframes iconPop {
    from { transform: scale(0.4) rotate(-12deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-8px); }
    30%, 60%, 90% { transform: translateX(8px); }
}

.shake-animation {
    animation: shakeError 0.4s ease-in-out;
    border-color: var(--color-red) !important;
}

/* ==========================================================================
   11. RESPONSIVE
   ========================================================================== */

/* Portátiles con poca altura */
@media (min-width: 1025px) and (max-height: 820px) {
    .hero-panel { padding-top: 2.5rem; padding-bottom: 2.5rem; }
    .hero-eyebrow { margin-bottom: 1.1rem; }
    .custom-logo { height: 4.6rem; }
    .hero-logo-wrapper { margin-bottom: 1.1rem; }
    .hero-divider { margin-bottom: 1.25rem; }
    .hero-description { font-size: 1.02rem; margin-bottom: 1.25rem; }
    .hero-features { margin-bottom: 1.1rem; }
    .fun-fact { margin-bottom: 1.1rem; }
    .auth-panel { padding-top: 6.5rem; }
}

/* Tablets */
@media (max-width: 1024px) {
    .viewport {
        display: flex;
        flex-direction: column;
    }

    .hero-panel {
        padding: calc(var(--safe-top) + 3.5rem) 2rem 2rem;
        align-items: center;
        text-align: center;
    }

    .hero-bg__gradient-dark {
        background: linear-gradient(to bottom, rgba(245, 250, 255, 0.35) 0%, rgba(245, 250, 255, 0.88) 55%, rgba(245, 250, 255, 0.97) 100%);
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-divider {
        margin: 0 auto 1.75rem auto;
        transform-origin: center;
    }

    .hero-features {
        justify-content: center;
    }

    .fun-fact {
        text-align: left;
    }

    .auth-panel {
        padding: 6.5rem 1.5rem calc(var(--safe-bottom) + 3rem);
        flex-grow: 1;
        align-items: flex-start;
    }

    .elegant-card {
        padding: 3rem 1.9rem 2rem;
    }

    .card-header {
        text-align: center;
    }
}

/* Teléfonos en vertical — afinado para Samsung Galaxy S25 FE (≈384 × 832) */
@media (max-width: 600px) {
    .hero-panel {
        padding: calc(var(--safe-top) + 1.5rem) 1.25rem 0.25rem;
    }

    .hero-eyebrow {
        font-size: 0.7rem;
        padding: 0.4rem 0.85rem;
        margin-bottom: 1rem;
    }

    .hero-logo-wrapper {
        margin-bottom: 0.9rem;
    }

    .custom-logo {
        height: 3.6rem;
    }

    .logo-indicators-massive {
        gap: 6px;
        margin-left: 8px;
        transform: translateY(-5px);
    }

        .logo-indicators-massive .indicator-dot {
            width: 8px;
            height: 8px;
        }

    .hero-divider {
        width: 56px;
        height: 4px;
        margin-bottom: 1rem;
    }

    .hero-heading {
        font-size: 2.1rem;
        margin-bottom: 0.7rem;
    }

    .hero-description {
        font-size: 0.97rem;
        line-height: 1.55;
        margin-bottom: 1.1rem;
    }

    /* Chips en carrusel horizontal deslizable (en vez de ocultarlos) */
    .hero-features {
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: calc(100% + 2.5rem);
        margin: 0 -1.25rem 0.5rem;
        padding: 0.3rem 1.25rem 0.6rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 1.25rem, #000 calc(100% - 1.25rem), transparent 100%);
        mask-image: linear-gradient(90deg, transparent 0, #000 1.25rem, #000 calc(100% - 1.25rem), transparent 100%);
    }

        .hero-features::-webkit-scrollbar {
            display: none;
        }

        .hero-features li {
            flex: 0 0 auto;
            scroll-snap-align: center;
            min-height: 44px;
            font-size: 0.82rem;
        }


    .fun-fact {
        padding: 1rem 1rem;
        gap: 0.8rem;
        border-radius: 18px;
    }

    .fun-fact__icon {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .fun-fact__label { font-size: 1rem; }
    .fun-fact__text { font-size: 0.95rem; }

    .floater {
        --s: 0.72;
        opacity: 0.75;
    }

        .floater:nth-child(n+6) {
            display: none;
        }

    .auth-panel {
        padding: 5.4rem 0.9rem calc(var(--safe-bottom) + 1.25rem);
    }

    .elegant-card {
        padding: 2.4rem 1.1rem 1.5rem;
        border-radius: 22px;
    }

    .mascot {
        --mascot-w: 118px;
    }

    .mascot-bubble {
        left: calc(50% + 50px);
        max-width: calc(50% - 36px);
        font-size: 0.8rem;
        padding: 0.5rem 0.65rem;
    }

    .card-header {
        margin-bottom: 1.5rem;
    }

    .card-header__badge {
        margin-bottom: 0.9rem;
    }

    .card-title {
        font-size: 1.55rem;
    }

    .card-subtitle {
        font-size: 0.93rem;
    }

    .field-group {
        margin-bottom: 1.3rem;
    }

    .form-options {
        margin-bottom: 1.4rem;
        gap: 0 0.5rem;
    }

    .remember-label {
        gap: 0.5rem;
    }

    .remember-text,
    .reset-link {
        font-size: 0.8rem;
    }

    .card-footer {
        margin-top: 1.4rem;
        padding-top: 1rem;
        font-size: 0.76rem;
    }

    .modal-panel {
        padding: 1.9rem 1.4rem;
    }
}

/* Teléfonos compactos (≤ 360px) */
@media (max-width: 360px) {
    .hero-heading { font-size: 1.85rem; }
    .custom-logo { height: 3.1rem; }
    .hero-description { font-size: 0.9rem; }
    .elegant-card { padding: 2.2rem 1rem 1.25rem; }
    .card-title { font-size: 1.4rem; }
    .form-options { flex-direction: column; align-items: flex-start; gap: 0; }
}

/* Teléfonos en horizontal (p. ej. S25 FE girado ≈ 832 × 384) */
@media (max-height: 520px) and (orientation: landscape) {
    .viewport {
        display: grid;
        grid-template-columns: 1fr 1.1fr;
    }

    .hero-panel {
        padding: 1.5rem 1.25rem 1.5rem max(1.5rem, var(--safe-left));
        text-align: left;
        align-items: flex-start;
    }

    .hero-content {
        align-items: flex-start;
    }

    .hero-divider {
        margin: 0 0 0.9rem;
    }

    .custom-logo { height: 3rem; }
    .hero-logo-wrapper { margin-bottom: 0.6rem; }
    .hero-heading { font-size: 1.8rem; margin-bottom: 0; }

    .hero-description,
    .hero-features,

    .auth-panel {
        padding: 5.2rem max(1.25rem, var(--safe-right)) 1.5rem 0.75rem;
        align-items: flex-start;
    }

    .elegant-card {
        padding: 2.2rem 1.5rem 1.25rem;
    }

    .mascot { --mascot-w: 108px; }
    .card-header { margin-bottom: 1rem; }
    .card-subtitle { display: none; }
    .card-footer { display: none; }
}


/* ==========================================================================
   12. INICIO POR CÁMARA (reconocimiento facial)
   ========================================================================== */

/* Separador «o entra sin escribir» */
.auth-or {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.15rem 0 0.85rem;
    color: var(--text-on-dark-faint);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.auth-or::before,
.auth-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border-strong), transparent);
}

/* Botón */
.btn-face {
    --bf-a: #8B5CF6;
    --bf-b: #0EA5E9;
    position: relative;
    width: 100%;
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.6rem 1rem 0.6rem 0.6rem;
    border-radius: 18px;
    border: 1.5px solid transparent;
    background:
        linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)) padding-box,
        linear-gradient(120deg, var(--bf-a), var(--bf-b) 55%, #10B981) border-box;
    box-shadow: 0 14px 30px -18px rgba(99, 102, 241, 0.65);
    color: var(--text-on-dark);
    font-family: var(--font-ui);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.btn-face::after {
    /* brillo que cruza el botón */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(139, 92, 246, 0.12) 50%, transparent 65%);
    transform: translateX(-100%);
    animation: shimmer 5s ease-in-out 3s infinite;
    pointer-events: none;
}
.btn-face:focus-visible { outline: 3px solid rgba(139, 92, 246, 0.45); outline-offset: 3px; }
.btn-face:active { transform: scale(0.985); }
.btn-face:disabled { opacity: 0.6; cursor: progress; }

.btn-face__icon {
    position: relative;
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, var(--bf-a) 0%, #6366F1 45%, var(--bf-b) 100%);
    box-shadow: 0 10px 18px -8px rgba(99, 102, 241, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform var(--dur-base) var(--ease-spring);
}
.btn-face__cam { position: relative; z-index: 1; filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.25)); }
.btn-face__iris { transform-origin: 16px 17.2px; transition: transform var(--dur-base) var(--ease-spring); }
.btn-face__led { animation: ledBlink 2.4s ease-in-out infinite; }

/* Esquinas de «enfoque» alrededor del ícono */
.btn-face__corners { position: absolute; inset: -5px; animation: focusPulse 2.6s var(--ease-out) infinite; }
.btn-face__corners i {
    position: absolute;
    width: 11px;
    height: 11px;
    border: 2.5px solid var(--bf-a);
    border-radius: 3px;
}
.btn-face__corners i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.btn-face__corners i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-color: var(--bf-b); }
.btn-face__corners i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-color: var(--bf-b); }
.btn-face__corners i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-color: #10B981; }

.btn-face__txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.btn-face__txt strong {
    font-family: var(--font-fun);
    font-weight: 700;
    font-size: 1.08rem;
    background: linear-gradient(90deg, #4C1D95, #1D4ED8 60%, #0369A1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.btn-face__txt small { margin-top: 1px; font-size: 0.78rem; color: var(--text-on-dark-muted); }
.btn-face__tag {
    flex: 0 0 auto;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #5B21B6;
    background: #EDE9FE;
}
.btn-face__chev { flex: 0 0 auto; color: #6366F1; transition: transform var(--dur-fast) var(--ease-out); }

@media (hover: hover) {
    .btn-face:hover { transform: translateY(-2px); box-shadow: 0 20px 34px -18px rgba(99, 102, 241, 0.8); }
    .btn-face:hover .btn-face__icon { transform: rotate(-6deg) scale(1.06); }
    .btn-face:hover .btn-face__iris { transform: scale(1.35); }
    .btn-face:hover .btn-face__chev { transform: translateX(4px); }
}

@keyframes focusPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.55; }
}

/* ---------- Ventana del escáner ---------- */
.face-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(9, 22, 44, 0.55);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-base), visibility var(--dur-base);
}
.face-overlay.active { opacity: 1; visibility: visible; }

.face-panel {
    position: relative;
    width: min(540px, 100%);
    max-height: calc(100dvh - 2.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.15rem 1.15rem 0.95rem;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 40px 80px -24px rgba(8, 20, 45, 0.55);
    transform: translateY(18px) scale(0.96);
    transition: transform var(--dur-base) var(--ease-spring);
}
.face-overlay.active .face-panel { transform: none; }

.face-head { display: flex; align-items: center; gap: 0.8rem; }
.face-head__icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(140deg, #8B5CF6, #0EA5E9);
    box-shadow: 0 8px 16px -8px rgba(99, 102, 241, 0.9);
    flex: 0 0 auto;
}
.face-head__titles { flex: 1; min-width: 0; }
.face-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6366F1;
}
.face-title { font-family: var(--font-fun); font-size: 1.3rem; font-weight: 700; line-height: 1.15; color: var(--text-main); }
.face-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--c-border);
    background: #fff;
    color: var(--text-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: 0 0 auto;
    transition: color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.face-close:hover { color: var(--text-main); border-color: var(--c-border-focus); }
.face-close:active { transform: scale(0.94); }

/* Escenario de la cámara */
.face-stage {
    position: relative;
    margin-top: 0.95rem;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    overflow: hidden;
    isolation: isolate;
    background: radial-gradient(120% 90% at 50% 30%, #1E3A8A 0%, #0B1B33 60%, #060F1F 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.face-video,
.face-shot,
.face-points {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.face-video,
.face-shot {
    object-fit: cover;
    transform: scaleX(-1);              /* vista tipo espejo, como una selfie */
}
.face-video { opacity: 0; transition: opacity 0.5s; }
.face-stage.has-video .face-video { opacity: 1; }
.face-shot { opacity: 0; }
.face-stage.is-upload .face-shot { transform: none; object-fit: contain; background: #0B1B33; }
.face-stage[data-state="analyzing"] .face-shot,
.face-stage[data-state="success"] .face-shot,
.face-stage[data-state="fail"] .face-shot { opacity: 1; }
.face-points { pointer-events: none; z-index: 3; }

/* Óvalo guía */
.face-oval {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    height: 78%;
    aspect-ratio: 0.78;
    transform: translate(-50%, -51%);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 0 1200px rgba(6, 16, 34, 0.5);
    transition: opacity 0.4s;
    pointer-events: none;
}
.face-stage[data-state="loading"] .face-oval,
.face-stage[data-state="error"] .face-oval { opacity: 0; }
.face-oval__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.face-oval__ring ellipse {
    fill: none;
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 3;
    stroke-dasharray: 7 8;
    stroke-linecap: round;
    animation: ovalDash 1.6s linear infinite;
    transition: stroke 0.3s;
}
.face-stage[data-fit="warn"] .face-oval__ring ellipse { stroke: #FBBF24; }
.face-stage[data-fit="good"] .face-oval__ring ellipse,
.face-stage[data-state="countdown"] .face-oval__ring ellipse { stroke: #34D399; stroke-dasharray: none; stroke-width: 4; }
.face-stage[data-fit="good"] .face-oval,
.face-stage[data-state="countdown"] .face-oval { box-shadow: 0 0 0 1200px rgba(6, 16, 34, 0.5), 0 0 30px 6px rgba(52, 211, 153, 0.55); }
.face-stage[data-state="success"] .face-oval__ring ellipse { stroke: #34D399; stroke-dasharray: none; }
.face-stage[data-state="fail"] .face-oval__ring ellipse { stroke: #F87171; stroke-dasharray: none; }

/* Línea de escaneo */
.face-oval__scan {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 34%;
    background: linear-gradient(180deg, transparent, rgba(56, 189, 248, 0.28) 70%, rgba(125, 211, 252, 0.95) 98%, transparent);
    transform: translateY(-110%);
    opacity: 0;
}
.face-stage[data-state="live"] .face-oval__scan { opacity: 0.45; animation: scanMove 2.8s ease-in-out infinite; }
.face-stage[data-state="analyzing"] .face-oval__scan { opacity: 1; animation: scanMove 1.1s ease-in-out infinite; }

/* Recuadro que sigue la cara */
.face-track {
    position: absolute;
    z-index: 3;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    transition: left 0.14s linear, top 0.14s linear, width 0.14s linear, height 0.14s linear, opacity 0.25s;
}
.face-track.is-on { opacity: 1; }
.face-track i {
    position: absolute;
    width: 22%;
    height: 22%;
    max-width: 26px;
    max-height: 26px;
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    transition: border-color 0.25s;
}
.face-track i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.face-track i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.face-track i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.face-track i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.face-stage[data-fit="good"] .face-track i { border-color: #34D399; }
.face-stage[data-fit="warn"] .face-track i { border-color: #FBBF24; }
.face-stage:not([data-state="live"]):not([data-state="countdown"]) .face-track { opacity: 0; }

/* Cuenta regresiva */
.face-count {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-fun);
    font-size: clamp(4rem, 16vw, 6.5rem);
    font-weight: 800;
    line-height: 1;
    color: #fff;
    text-shadow: 0 6px 30px rgba(16, 185, 129, 0.8), 0 2px 0 rgba(0, 0, 0, 0.25);
    pointer-events: none;
    opacity: 0;
}
.face-count.is-pop { animation: countPop 0.72s var(--ease-out) forwards; }

/* Flash de la foto */
.face-flash { position: absolute; inset: 0; z-index: 6; background: #fff; opacity: 0; pointer-events: none; }
.face-flash.is-on { animation: camFlash 0.55s ease-out; }

/* Cargando */
.face-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 1.5rem;
    color: #E0F2FE;
    text-align: center;
    transition: opacity 0.35s, visibility 0.35s;
}
.face-stage:not([data-state="loading"]) .face-loading { opacity: 0; visibility: hidden; }
.face-loading__orb { position: relative; width: 74px; height: 74px; }
.face-loading__orb span {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #38BDF8;
    animation: spin 1.1s linear infinite;
}
.face-loading__orb span:nth-child(2) { inset: 10px; border-top-color: #A78BFA; animation-duration: 1.6s; animation-direction: reverse; }
.face-loading__orb span:nth-child(3) { inset: 21px; border-top-color: #34D399; animation-duration: 0.9s; }
.face-loading__text { font-family: var(--font-fun); font-size: 1.02rem; font-weight: 600; }
.face-loading__bar { width: min(240px, 70%); height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.face-loading__bar span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38BDF8, #A78BFA, #34D399);
    transform-origin: left;
    transform: scaleX(0.04);
    transition: transform 0.4s var(--ease-out);
}

/* Resultado y avisos sobre la imagen */
.face-result {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(8, 20, 42, 0.42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
}
.face-stage[data-state="success"] .face-result,
.face-stage[data-state="fail"] .face-result,
.face-stage[data-state="error"] .face-result { opacity: 1; visibility: visible; }
.face-stage[data-state="error"] .face-result { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

.face-card {
    --rc: #0EA5E9;
    width: min(330px, 100%);
    max-height: 100%;
    overflow-y: auto;
    padding: 1.2rem 1.15rem 1.1rem;
    border-radius: 20px;
    background: #fff;
    text-align: center;
    box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.55);
    animation: cardRise 0.55s var(--ease-spring) both;
}
.face-card__avatar {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 0.65rem;
    border-radius: 50%;
    padding: 5px;
    background: conic-gradient(from var(--angle), var(--rc), #fff, var(--rc), #34D399, var(--rc));
    animation: borderSpin 3s linear infinite;
}
.face-card__avatar img,
.face-card__avatar b {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
    background: color-mix(in srgb, var(--rc) 18%, white);
    color: var(--rc);
    font-family: var(--font-fun);
    font-size: 2rem;
}
.face-card__badge {
    position: absolute;
    right: -2px;
    bottom: 2px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: #10B981;
    border: 3px solid #fff;
    animation: badgePop 0.5s var(--ease-spring) 0.25s both;
}
.face-card__hello { font-family: var(--font-fun); font-size: 1.55rem; font-weight: 800; line-height: 1.1; color: var(--text-main); }
.face-card__course {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.45rem;
    padding: 0.25rem 0.7rem 0.25rem 0.3rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: color-mix(in srgb, var(--rc) 70%, #0F172A);
    background: color-mix(in srgb, var(--rc) 12%, white);
}
.face-card__course img { width: 22px; height: 22px; object-fit: contain; border-radius: 6px; background: #fff; }
.face-card__meter { margin-top: 0.85rem; text-align: left; }
.face-card__meter-top { display: flex; justify-content: space-between; font-size: 0.74rem; font-weight: 700; color: var(--text-muted); }
.face-card__meter-top b { font-family: var(--font-mono); color: #059669; }
.face-card__meter-bar { margin-top: 4px; height: 7px; border-radius: 99px; background: #E2E8F0; overflow: hidden; }
.face-card__meter-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34D399, #10B981); width: 0; transition: width 0.9s var(--ease-out) 0.2s; }
.face-card__go { margin-top: 0.8rem; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.face-card__go-bar { margin-top: 0.4rem; height: 4px; border-radius: 99px; background: #E0F2FE; overflow: hidden; }
.face-card__go-bar span { display: block; height: 100%; background: var(--rc); transform-origin: left; animation: goFill 1.8s linear both; }

.face-card__emoji { font-size: 2.6rem; line-height: 1; margin-bottom: 0.35rem; }
.face-card__title { font-family: var(--font-fun); font-size: 1.3rem; font-weight: 800; color: var(--text-main); line-height: 1.15; }
.face-card__text { margin-top: 0.35rem; font-size: 0.86rem; line-height: 1.45; color: var(--text-muted); }
.face-card__text code { font-family: var(--font-mono); font-size: 0.78rem; padding: 0.05rem 0.3rem; border-radius: 5px; background: #F1F5F9; color: #334155; }
.face-card__tips { margin: 0.6rem 0 0; padding: 0; list-style: none; text-align: left; font-size: 0.8rem; color: #334155; display: grid; gap: 0.3rem; }
.face-card__tips li { display: flex; gap: 0.45rem; align-items: flex-start; }
.face-card__tips li::before { content: '✓'; color: #10B981; font-weight: 800; }
.face-card__actions { display: flex; gap: 0.5rem; margin-top: 0.9rem; }
.face-card__actions > * { flex: 1; }

.face-cta {
    min-height: 44px;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    border: 0;
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6366F1, #0EA5E9);
    box-shadow: 0 10px 18px -10px rgba(79, 70, 229, 0.9);
    cursor: pointer;
    transition: transform var(--dur-fast), filter var(--dur-fast);
}
.face-cta:hover { filter: brightness(1.06); transform: translateY(-1px); }
.face-cta:active { transform: scale(0.97); }
.face-cta--soft { color: #334155; background: #F1F5F9; box-shadow: none; }

/* Texto de estado */
.face-status {
    min-height: 1.6em;
    margin: 0.8rem 0 0.15rem;
    text-align: center;
    font-family: var(--font-fun);
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text-main);
    transition: color 0.3s;
}
.face-status.is-good { color: #059669; }
.face-status.is-warn { color: #B45309; }
.face-status.is-bad { color: #DC2626; }

/* Acciones */
.face-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.55rem;
}
.face-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.55rem 0.8rem;
    border-radius: 14px;
    border: 1.5px solid var(--c-border);
    background: #fff;
    color: #334155;
    font-family: var(--font-ui);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.face-btn:hover { border-color: #A5B4FC; color: #4338CA; }
.face-btn:active { transform: scale(0.97); }
.face-btn:focus-within,
.face-btn:focus-visible { outline: 3px solid rgba(99, 102, 241, 0.3); outline-offset: 2px; }
#faceUploadLabel { justify-self: end; }
#facePassword { justify-self: start; }

.face-shutter {
    position: relative;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.face-shutter__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from var(--angle), #8B5CF6, #0EA5E9, #10B981, #8B5CF6);
    animation: borderSpin 4s linear infinite;
}
.face-shutter__ring::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.face-shutter__core {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #7DD3FC, #0284C7 60%, #1E3A8A);
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.25), 0 6px 14px -6px rgba(2, 132, 199, 0.9);
    transition: transform 0.2s var(--ease-spring), background 0.3s;
}
.face-shutter:hover .face-shutter__core { transform: scale(1.06); }
.face-shutter:active .face-shutter__core { transform: scale(0.86); }
.face-shutter:disabled { cursor: default; opacity: 0.4; filter: grayscale(0.6); }
.face-shutter:disabled .face-shutter__ring { animation: none; }
.face-shutter.is-ready .face-shutter__core { background: radial-gradient(circle at 35% 30%, #6EE7B7, #10B981 60%, #047857); animation: shutterBeat 0.9s ease-in-out infinite; }
.face-shutter:focus-visible { outline: 3px solid rgba(99, 102, 241, 0.45); outline-offset: 3px; }

.face-privacy {
    margin-top: 0.8rem;
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--text-muted);
    text-align: center;
}
.face-privacy svg { display: inline; vertical-align: -2px; margin-right: 3px; color: #10B981; }
.face-stage:is([data-state="success"], [data-state="fail"], [data-state="error"]) + .face-status { visibility: hidden; }

body.face-open { overflow: hidden; }

@keyframes ovalDash { to { stroke-dashoffset: -30; } }
@keyframes scanMove {
    0% { transform: translateY(-110%); }
    100% { transform: translateY(300%); }
}
@keyframes countPop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); }
    25% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
}
@keyframes camFlash {
    0% { opacity: 0.95; }
    100% { opacity: 0; }
}
@keyframes cardRise {
    from { opacity: 0; transform: translateY(18px) scale(0.94); }
    to { opacity: 1; transform: none; }
}
@keyframes goFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes shutterBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.9); }
}

/* Teléfono: el escáner ocupa la pantalla como hoja inferior */
@media (max-width: 600px) {
    .btn-face { min-height: 62px; }
    .btn-face__txt small { font-size: 0.74rem; }
    .btn-face__tag { display: none; }

    .face-overlay { padding: 0; align-items: flex-end; }
    .face-panel {
        width: 100%;
        max-height: 100dvh;
        border-radius: 26px 26px 0 0;
        padding: 0.9rem max(0.9rem, var(--safe-left)) max(0.9rem, var(--safe-bottom)) max(0.9rem, var(--safe-right));
        transform: translateY(40px);
    }
    .face-stage { aspect-ratio: 3 / 4; max-height: calc(100dvh - 285px); min-height: 300px; }
    .face-oval { height: 70%; }
    .face-title { font-size: 1.15rem; }
    .face-btn span { font-size: 0.8rem; }
    .face-btn { padding: 0.5rem 0.6rem; }
    .face-shutter { width: 68px; height: 68px; }
}

/* Teléfono horizontal o pantallas bajas */
@media (max-height: 560px) and (orientation: landscape) {
    .face-overlay { padding: 0.5rem; align-items: center; }
    .face-panel { max-height: calc(100dvh - 1rem); border-radius: 22px; }
    .face-stage { aspect-ratio: auto; height: calc(100dvh - 205px); min-height: 180px; max-height: none; }
    .face-privacy { display: none; }
}

/* ==========================================================================
   Entrada rápida con rostro (dispositivo de confianza)
   ========================================================================== */
.quick-face[hidden] { display: none; }
.quick-face { margin: 0.4rem 0 0.2rem; animation: qfIn .5s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes qfIn { from { opacity: 0; transform: translateY(8px); } }
.quick-face__who { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.85rem; }
.quick-face__avatar {
    flex: none; width: 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center;
    font-family: var(--font-display, 'Red Hat Display', sans-serif); font-weight: 800; font-size: 1rem; color: #fff;
    background: linear-gradient(135deg, #0EA5E9, #6366F1);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .14), 0 10px 22px -12px rgba(14, 165, 233, .9);
}
.quick-face__txt { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.quick-face__hello { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-on-dark-faint, #9fb3c8); }
.quick-face__txt strong { font-size: 1.02rem; color: var(--text-on-dark, #fff); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-face__txt small { font-size: 0.78rem; color: var(--text-on-dark-faint, #9fb3c8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-face__other {
    flex: none; padding: 0.45rem 0.7rem; border-radius: 10px;
    border: 1px solid var(--glass-border-strong, rgba(14, 116, 178, .25)); background: rgba(14, 116, 178, .06);
    color: var(--text-on-dark, #0B1B33); font: 600 0.76rem/1 var(--font-ui, sans-serif); cursor: pointer;
}
.quick-face__other:hover { background: rgba(14, 116, 178, .12); }
.quick-face__other:focus-visible { outline: 3px solid rgba(139, 92, 246, 0.45); outline-offset: 2px; }
.quick-face__go.is-busy { pointer-events: none; opacity: .75; }
