@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/sora-latin-400-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/sora-latin-500-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/sora-latin-700-normal.woff2') format('woff2');
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    background: #05070C;
    color: #F5F8FC;

    font-family: 'Sora', sans-serif;
    overflow: hidden;
}

/* ----------------------------------------
   Fondo de malla líquida (global)
   ---------------------------------------- */

#fondo-malla {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    z-index: 0;
    display: block;
}

/* ----------------------------------------
   Pantallas (inicio / entrevista)
   ---------------------------------------- */

.pantalla {
    display: none;

    width: 100vw;
    height: 100vh;

    align-items: center;
    justify-content: center;

    position: fixed;
    inset: 0;
    z-index: 1;

    flex-direction: column;
    text-align: center;
    padding: 24px;
}

.pantalla.activa {
    display: flex;
}

/* Transición de desenfoque + foco entre pantallas */

.pantalla.transicion-salida {
    animation: desenfocarSalir 0.5s ease forwards;
}

@keyframes desenfocarSalir {
    to {
        filter: blur(20px);
        opacity: 0;
        transform: scale(1.05);
    }
}

.pantalla.transicion-entrada {
    animation: enfocarEntrar 0.6s ease forwards;
}

@keyframes enfocarEntrar {
    from {
        filter: blur(20px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

/* ----------------------------------------
   Pantalla de inicio
   ---------------------------------------- */

.marca {
    font-weight: 700;
    font-size: 52px;
    letter-spacing: -1px;
    color: #fff;
    margin: 0 0 8px;
    transition: text-shadow 0.15s ease;
}

.tagline {
    font-weight: 500;
    font-size: 13px;
    color: #94A3B8;
    margin: 0 0 24px;
}

.frase-rotativa {
    font-size: 13px;
    color: #5C7080;
    height: 18px;
    margin: 0 0 40px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.frase-rotativa.visible {
    opacity: 1;
}

.botones-modo {
    display: flex;
    flex-direction: column;
    gap: 14px;

    width: 100%;
    max-width: 340px;
}

.boton-modo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;

    background: rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(26px) saturate(220%) brightness(1.1);
    -webkit-backdrop-filter: blur(26px) saturate(220%) brightness(1.1);

    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 26px;
    padding: 18px 22px;

    cursor: pointer;
    overflow: hidden;
    text-align: left;

    color: #F5F8FC;
    font-family: 'Sora', sans-serif;

    transition: border-color 0.25s ease, transform 0.2s ease;
}

/* El brillo que cruza lentamente el botón en loop, como luz
   real moviéndose sobre un cristal. */
.boton-modo::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -150%;
    width: 60%;
    height: 200%;
    background: linear-gradient(75deg,
        transparent 30%,
        rgba(255, 255, 255, 0.16) 48%,
        rgba(255, 255, 255, 0.02) 55%,
        transparent 70%);
    animation: brillo-pasa 7s ease-in-out infinite;
    pointer-events: none;
}

@keyframes brillo-pasa {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(280%); }
}

.boton-modo:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.28);
}

.boton-modo:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

.boton-modo-icono {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.boton-modo-icono svg {
    width: 100%;
    height: 100%;
    stroke: rgba(245, 248, 252, 0.92);
}

.boton-modo-texto {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.boton-modo-titulo {
    font-size: 15px;
    font-weight: 700;
}

.boton-modo-desc {
    font-size: 11.5px;
    font-weight: 400;
    color: rgba(245, 248, 252, 0.6);
}

/* Modo "atráeme": cuando nadie interactúa por un rato */

.atraeme {
    font-size: 14px;
    color: #5AC8FF;
    margin-top: 28px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#pantalla-inicio.atrayendo .atraeme {
    opacity: 1;
    animation: pulsarInvitacion 1.8s ease-in-out infinite;
}

@keyframes pulsarInvitacion {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* ----------------------------------------
   Pantalla de entrevista
   ---------------------------------------- */

.contenido-entrevista {
    text-align: center;
    padding: 24px;

    max-width: 560px;
    width: 90%;
}

.marca-chica {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 1px;
    color: #fff;
    margin: 0 0 24px;
    transition: text-shadow 0.15s ease;
}

.progreso {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
    min-height: 3px;
}

.progreso .punto {
    width: 20px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.3s ease;
}

.progreso .punto.completado {
    background: #fff;
}

#estado {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    font-size: 13px;
    color: #94A3B8;
    min-height: 18px;
}

.punto-estado {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #5C7080;
    flex-shrink: 0;
}

#estado.escuchando .punto-estado {
    background: #5AC8FF;
    animation: latido 1.4s ease-in-out infinite;
}

#estado.hablando .punto-estado {
    background: #ffffff;
    animation: none;
}

#estado.procesando .punto-estado {
    background: #F5A623;
    animation: latido 0.8s ease-in-out infinite;
}

@keyframes latido {
    0%, 100% { opacity: 0.4; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* ----------------------------------------
   Cronómetro (solo durante la entrevista)
   ---------------------------------------- */

/* ----------------------------------------
   Indicador de calidad de conexión (siempre visible)
   ---------------------------------------- */

.indicador-red {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 5;

    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;

    cursor: default;
}

.indicador-red .barra {
    display: block;
    width: 4px;
    border-radius: 2px;
    background: rgba(245, 248, 252, 0.22);
    transition: background 0.5s ease;
}

.indicador-red .barra-1 { height: 6px; }
.indicador-red .barra-2 { height: 11px; }
.indicador-red .barra-3 { height: 16px; }

.indicador-red .barra.activa {
    background: rgba(245, 248, 252, 0.85);
}

/* Regular (arranca así por defecto, hasta la primera medición
   real): las barras activas se ven en ámbar. */
.indicador-red.regular .barra.activa {
    background: #F5A623;
}

/* Mala conexión: barras activas en rojo suave. */
.indicador-red.mala .barra.activa {
    background: #E5484D;
}


/* ----------------------------------------
   Aviso de posibles errores/demoras por conexión
   ---------------------------------------- */

.aviso-conexion {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;

    max-width: 320px;
    text-align: center;

    font-size: 10.5px;
    font-weight: 400;
    color: rgba(245, 248, 252, 0.4);
    letter-spacing: 0.2px;
    line-height: 1.4;

    pointer-events: none;
}


#cronometro {
    display: none;

    position: fixed;
    top: 44px;
    right: 24px;
    z-index: 3;

    font-size: 12px;
    color: #5C7080;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

#pantalla-entrevista.activa ~ #cronometro {
    display: block;
}

/* ----------------------------------------
   Chat en vivo (solo durante la entrevista)
   ---------------------------------------- */

.chat-card {
    display: none;

    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 3;

    max-width: 280px;

    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 14px 16px;

    text-align: left;

    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#pantalla-entrevista.activa ~ .chat-card {
    display: block;
}

.chat-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.chat-card .quien {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #5AC8FF;
    margin: 0 0 4px;
}

.chat-card .texto {
    font-size: 13px;
    color: #E3EAF2;
    margin: 0;
    line-height: 1.4;
}

/* ----------------------------------------
   Código QR (solo durante la entrevista)
   ---------------------------------------- */

.qr-card {
    display: none;

    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3;

    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 12px;

    text-align: center;
}

#pantalla-entrevista.activa ~ .qr-card {
    display: block;
}

.qr-card img {
    width: 76px;
    height: 76px;
    display: block;
    border-radius: 6px;
}

.qr-card p {
    font-size: 9px;
    color: #94A3B8;
    margin: 6px 0 0;
    letter-spacing: 0.5px;
}

/* ----------------------------------------
   Tarjeta "hablá con LEDA desde tu celular"
   (solo en la pantalla de inicio)
   ---------------------------------------- */

.qr-leda-card {
    position: fixed;
    top: 50%;
    left: 32px;
    transform: translateY(-50%);
    z-index: 4;

    width: 200px;

    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    border-radius: 28px;
    padding: 20px;

    text-align: center;

    /* El borde en sí: un degradé animado detrás, visible solo
       a través del padding (truco del doble fondo con
       background-origin). */
    border: 2px solid transparent;
    background-image:
        linear-gradient(rgba(5, 7, 12, 0.92), rgba(5, 7, 12, 0.92)),
        linear-gradient(130deg, #2E7BBF 10%, #E8F4FF 40%, #D9B8FF 60%, #6A2E9F 90%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-size: 100% 100%, 320% 320%;
    background-position: 0 0, 0% 50%;

    animation: brillo-borde-qr-leda 6s ease-in-out infinite;

    box-shadow: 0 0 28px -3px rgba(90, 200, 255, 0.5);
}

#pantalla-entrevista.activa ~ .qr-leda-card {
    display: none;
}

/* En celulares no tiene sentido invitar a "escanear desde tu
   celular" — probablemente ya están en el celular. La sacamos
   del todo en pantallas chicas. */
@media (max-width: 640px) {
    .qr-leda-card {
        display: none;
    }
}

@keyframes brillo-borde-qr-leda {
    0%, 100% { background-position: 0 0, 0% 50%; }
    50% { background-position: 0 0, 100% 50%; }
}

.qr-leda-texto {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: #F5F8FC;
    margin: 0 0 14px;
}

.qr-leda-card img {
    width: 100%;
    max-width: 155px;
    display: block;
    margin: 0 auto;
    border-radius: 16px;
}

/* ----------------------------------------
   Botón de finalizar (solo durante la entrevista)
   ---------------------------------------- */

.finalizar {
    display: none;

    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;

    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #94A3B8;
    padding: 9px 20px;
    border-radius: 999px;

    font-size: 12px;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
}

#pantalla-entrevista.activa ~ .finalizar {
    display: block;
}

.finalizar:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #F5F8FC;
}

/* ----------------------------------------
   Crédito de autoría (siempre visible)
   ---------------------------------------- */

.credito {
    position: fixed;
    top: 20px;
    left: 24px;
    z-index: 3;

    font-size: 11px;
    color: #4A5A6B;
    letter-spacing: 0.5px;
    margin: 0;
}
