/* ============================================
   TIPOGRAFÍAS AUTOHOSPEDADAS
   (antes cargadas desde fonts.googleapis.com — ahora en assets/fonts/,
   sin dependencia de red externa)
   ============================================ */

@font-face {
    font-family: "Atkinson Hyperlegible";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../assets/fonts/atkinson-regular-400.woff2") format("woff2");
}

@font-face {
    font-family: "Atkinson Hyperlegible";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../assets/fonts/atkinson-regular-700.woff2") format("woff2");
}

@font-face {
    font-family: "Atkinson Hyperlegible";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("../assets/fonts/atkinson-italic-400.woff2") format("woff2");
}

@font-face {
    font-family: "Atkinson Hyperlegible";
    font-style: italic;
    font-weight: 700;
    font-display: swap;
    src: url("../assets/fonts/atkinson-italic-700.woff2") format("woff2");
}

@font-face {
    font-family: "Merriweather";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("../assets/fonts/merriweather-variable.woff2") format("woff2");
}

/* ============================================
   ESTILOS GLOBALES Y ACCESIBILIDAD
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Atkinson Hyperlegible", "Verdana", "Segoe UI", sans-serif;
    font-size: 24px;
    line-height: 1.6;
    color: var(--granate);
    background-color: #FAF8F3;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   TIPOGRAFÍA: GIGANTE Y LEGIBLE
   ============================================ */

h1 {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 16px;
    color: var(--granate);
    letter-spacing: 1px;
}

h2 {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--granate);
    margin-top: 20px;
}

h3 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 16px;
    color: var(--granate);
}

p {
    font-size: 24px;
    margin-bottom: 16px;
    line-height: 1.8;
    color: var(--granate);
}

strong {
    font-weight: bold;
    color: var(--granate);
}

/* Títulos con serif académica (Merriweather), evocando la identidad universitaria */
h1,
h2,
h3 {
    font-family: "Merriweather", "Georgia", serif;
}

/* ============================================
   CONTRASTE ALTO Y COLORES
   ============================================ */

/*
   PALETA "CIELO SERENO"
   ------------------------------------------------------------------
   Azul suave, arena cálida y coral — pensada para transmitir calma
   y cercanía a adultos mayores, con alto contraste para legibilidad.
   (Los nombres de las variables se conservan por compatibilidad con
   el resto del CSS; ya no representan colores institucionales).
*/
:root {
    /* Marca principal — azul sereno */
    --granate: #4A7C94;
    --granate-oscuro: #375D6F;

    /* Acento vivo — coral suave */
    --verde: #E0836B;
    --verde-oscuro: #9D5C4B;

    /* Acento cálido — arena, y neutros de fondo */
    --dorado: #D4A574;
    --dorado-oscuro: #9F7C57;
    --crema: #FAF8F3;
    --crema-tarjeta: #F3EAD9;
    --crema-usuario: #ECDFC7;
    --tinta: #2E3A45;        /* texto principal: gris azulado oscuro, alto contraste */

    /* Tokens semánticos (compatibilidad con el resto del CSS) */
    --color-principal: var(--granate);
    --color-fondo: var(--crema);
    --color-texto: var(--tinta);
    --color-borde: var(--granate);
    --color-boton-principal: var(--granate);
    --color-boton-texto: var(--crema);
    --color-boton-hover: var(--granate-oscuro);
    --color-acento: var(--dorado);
    --color-error: #B3261E;
    --color-exito: var(--verde);
    --color-info: var(--granate);
}

/* ============================================
   UTILIDAD: OCULTAR / MOSTRAR BLOQUES
   ============================================ */

.oculto {
    display: none !important;
}

/* ============================================
   COMPONENTES: BOTONES
   ============================================ */

button {
    font-family: "Atkinson Hyperlegible", "Verdana", "Segoe UI", sans-serif;
    font-size: 24px;
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.boton-principal {
    background-color: var(--color-boton-principal);
    color: var(--color-boton-texto);
    border: 3px solid var(--color-principal);
    padding: 20px 40px;
    font-size: 28px;
    min-height: 70px;
}

.boton-principal:hover:not(:disabled) {
    background-color: var(--color-boton-hover);
    box-shadow: 0 6px 12px rgba(74, 124, 148, 0.3);
    transform: translateY(-2px);
}

.boton-principal:focus {
    outline: 4px solid var(--color-acento);
    outline-offset: 4px;
}

.boton-principal:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #999999;
}

.boton-secundario {
    background-color: var(--color-fondo);
    color: var(--color-principal);
    border: 3px solid var(--color-principal);
    font-size: 20px;
}

.boton-secundario:hover {
    background-color: var(--crema-tarjeta);
    box-shadow: 0 4px 8px rgba(74, 124, 148, 0.2);
}

.boton-secundario:focus {
    outline: 4px solid var(--color-acento);
    outline-offset: 4px;
}

.boton-enviar,
.boton-pausa {
    background-color: var(--color-principal);
    color: var(--color-boton-texto);
    border: 3px solid var(--color-principal);
    font-size: 22px;
    padding: 14px 28px;
    min-height: 60px;
    flex: 1;
}

.boton-microfono {
    background-color: var(--verde);
    color: var(--crema);
    border: 3px solid var(--verde);
    font-size: 22px;
    padding: 14px 28px;
    min-height: 60px;
    flex: 1;
    font-weight: bold;
}

.boton-enviar:hover,
.boton-pausa:hover {
    background-color: var(--color-boton-hover);
    box-shadow: 0 4px 8px rgba(74, 124, 148, 0.2);
}

.boton-microfono:hover {
    background-color: var(--verde-oscuro);
    box-shadow: 0 4px 8px rgba(224, 131, 107, 0.35);
}

/* Estado activo del micrófono: rojo pulsante para indicar que está grabando */
.boton-microfono.activo {
    background-color: #cc0000;
    border-color: #cc0000;
    color: #ffffff;
    animation: pulso-grabando 1.2s ease-in-out infinite;
}

.boton-microfono.activo:hover {
    background-color: #aa0000;
    box-shadow: 0 4px 8px rgba(204, 0, 0, 0.4);
}

@keyframes pulso-grabando {
    0%, 100% { box-shadow: 0 0 0 0 rgba(204, 0, 0, 0.5); }
    50%       { box-shadow: 0 0 0 10px rgba(204, 0, 0, 0); }
}

.boton-enviar:focus,
.boton-microfono:focus,
.boton-pausa:focus {
    outline: 4px solid var(--color-acento);
    outline-offset: 4px;
}

/* Botón Pausar: inactivo mientras el agente no está hablando */
.boton-pausa:disabled {
    background-color: #E7DECF;
    border-color: #D8CBAF;
    color: #A9987F;
    cursor: not-allowed;
    box-shadow: none;
}

/* Botón Enviar resaltado cuando el mensaje de voz está listo */
.resaltado-listo {
    background-color: var(--verde) !important;
    border-color: var(--verde) !important;
    color: #ffffff !important;
    animation: pulso-listo 1s ease-in-out infinite;
    box-shadow: 0 0 0 4px rgba(224, 131, 107, 0.25);
}

@keyframes pulso-listo {
    0%, 100% { box-shadow: 0 0 0 0 rgba(224, 131, 107, 0.5); }
    50%       { box-shadow: 0 0 0 10px rgba(224, 131, 107, 0); }
}

/* Barra de estado: mensaje listo para enviar */
.estado-sistema.estado-listo {
    background-color: #FBEAE5;
    border-color: var(--verde);
    color: var(--verde);
    font-weight: bold;
    animation: parpadeo-listo 0.9s ease-in-out 3;
}

@keyframes parpadeo-listo {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.55; }
}

/* ============================================
   COMPONENTES: CAMPOS DE ENTRADA
   ============================================ */

input[type="text"],
input[type="password"],
textarea {
    font-family: "Atkinson Hyperlegible", "Verdana", "Segoe UI", sans-serif;
    font-size: 24px;
    padding: 16px;
    border: 3px solid var(--color-borde);
    border-radius: 8px;
    width: 100%;
    line-height: 1.6;
    color: var(--color-texto);
    background-color: var(--color-fondo);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-acento);
    box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.2);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: #999999;
    font-size: 22px;
}

/* ============================================
   COMPONENTES: CHECKBOX Y LABELS
   ============================================ */

input[type="checkbox"] {
    width: 32px;
    height: 32px;
    cursor: pointer;
    margin-right: 16px;
    accent-color: var(--color-acento);
}

label {
    font-size: 24px;
    color: var(--color-texto);
    cursor: pointer;
    display: block;
    margin-bottom: 12px;
}

.label-oculto {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.input-nombre {
    font-family: "Atkinson Hyperlegible", "Verdana", "Segoe UI", sans-serif;
    font-size: 19px;
    padding: 12px 14px;
    border: 3px solid var(--color-borde);
    border-radius: 8px;
    width: 100%;
    line-height: 1.6;
    color: var(--color-texto);
    background-color: var(--color-fondo);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-nombre:focus {
    outline: none;
    border-color: var(--color-acento);
    box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.2);
}

.input-apikey {
    font-family: "Atkinson Hyperlegible", "Verdana", "Segoe UI", sans-serif;
    font-size: 19px;
    padding: 12px 14px;
    border: 3px solid var(--color-borde);
    border-radius: 8px;
    width: 100%;
    line-height: 1.6;
    color: var(--color-texto);
    background-color: var(--color-fondo);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    letter-spacing: 0.1em;
}

.input-apikey:focus {
    outline: none;
    border-color: var(--color-acento);
    box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.2);
}

/* Mensaje de error de la pantalla de bienvenida */
.mensaje-error {
    font-size: 22px;
    color: var(--color-error);
    margin-top: 16px;
    display: none;
}

.mensaje-error.visible {
    display: block;
}

/* ============================================
   PANTALLA 2: SALA DE CONVERSACIÓN — MODO COMPAÑÍA
   ============================================ */

.sala {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, #FFFDF9 0%, var(--crema) 55%, #F7EFE2 100%);
}

/* --- Barra superior mínima --- */

.sala-barra {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 24px;
    background-color: rgba(253, 251, 247, 0.92);
    border-bottom: 3px solid var(--dorado);
    border-image: linear-gradient(90deg, var(--granate) 0%, var(--dorado) 50%, var(--verde) 100%) 1;
}

.sala-marca {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sala-icono {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.sala-marca h1 {
    font-size: 26px;
    margin-bottom: 0;
    color: var(--granate);
}

.sala-acciones {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Escenario central: Emilio (izq.) + su voz (der.) --- */

.sala-escenario {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 36px;
    padding: 24px 32px;
}

/* Bloque izquierdo: nombre + avatar */
.escena-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sala-escenario #contenedor-avatar {
    width: 240px;
    height: 240px;
    margin: 0;
}

/* Bloque derecho: globo de diálogo + estado */
.escena-dialogo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 640px;
}

.sala-escenario .estado-sistema {
    margin: 0;
    align-self: flex-start;
}

/* --- Barra de entrada inferior --- */

.sala-entrada {
    flex-shrink: 0;
    padding: 12px 24px 16px;
    background-color: rgba(253, 251, 247, 0.96);
    border-top: 1px solid #E7DECF;
}

.barra-entrada {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
}

.barra-entrada .boton-microfono {
    flex: 0 0 auto;
}

.barra-entrada input {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 22px;
    padding: 16px;
}

.barra-entrada .boton-enviar {
    flex: 0 0 auto;
}

.barra-entrada .boton-pausa {
    flex: 0 0 auto;
    min-width: auto;
    padding: 16px 22px;
}

/* --- Burbujas del historial --- */

.mensaje {
    margin-bottom: 20px;
    padding: 16px 18px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.mensaje-usuario {
    background-color: var(--crema-usuario);
    border-left: 5px solid var(--granate);
}

.mensaje-agente {
    background-color: var(--crema-tarjeta);
    border-left: 5px solid var(--verde);
}

.mensaje p {
    font-size: 22px;
    margin-bottom: 0;
    color: var(--tinta);
}

.etiqueta-remitente {
    font-size: 16px;
    font-weight: bold;
    color: var(--granate);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Estado del sistema --- */

.estado-sistema {
    background-color: var(--crema-tarjeta);
    border: 2px solid var(--color-borde);
    border-radius: 30px;
    padding: 8px 20px;
    font-size: 18px;
    color: var(--granate);
    text-align: center;
    flex-shrink: 0;
}

.estado-sistema p {
    font-size: 18px;
    margin-bottom: 0;
}

.estado-sistema.escuchando {
    background-color: #F7EAD6;
    border-color: #D4A574;
    color: var(--granate);
}

.estado-sistema.procesando {
    background-color: var(--crema-usuario);
    border-color: var(--granate);
    color: var(--granate);
}

.estado-sistema.error {
    background-color: #ffcccc;
    border-color: #cc0000;
    color: #cc0000;
}

/* --- Respuestas rápidas --- */

.respuestas-rapidas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 1180px;
    margin: 0 auto 12px;
}

.boton-rapido {
    background-color: #FAF8F3;
    color: var(--granate);
    border: 2px solid var(--granate);
    border-radius: 30px;
    font-size: 19px;
    padding: 10px 18px;
    min-height: auto;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 0 0 auto;
    white-space: nowrap;
}

.boton-rapido:hover {
    background-color: var(--granate);
    color: #FAF8F3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 124, 148, 0.2);
}

.boton-rapido:active {
    transform: translateY(0);
    box-shadow: none;
}

.boton-rapido:focus {
    outline: 3px solid var(--color-acento);
    outline-offset: 3px;
}

/* --- Botones tipo chip (barra superior / panel) --- */

.boton-chip {
    background-color: #FFFFFF;
    color: var(--granate);
    border: 2px solid var(--granate);
    border-radius: 30px;
    font-size: 17px;
    font-weight: bold;
    padding: 10px 18px;
    min-height: auto;
}

.boton-chip:hover {
    background-color: var(--granate);
    color: var(--crema);
}

/* --- Panel lateral de historial (drawer) --- */

.fondo-historial {
    position: fixed;
    inset: 0;
    background: rgba(42, 33, 30, 0.40);
    z-index: 40;
}

.panel-historial {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(460px, 92vw);
    z-index: 50;
    display: flex;
    flex-direction: column;
    background: var(--crema);
    box-shadow: -12px 0 40px rgba(42, 33, 30, 0.25);
}

.panel-historial-cab {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background-color: var(--granate);
    color: var(--crema);
    border-bottom: 4px solid var(--dorado);
    border-image: linear-gradient(90deg, var(--granate) 0%, var(--dorado) 50%, var(--verde) 100%) 1;
}

.panel-historial-cab h2 {
    font-size: 24px;
    margin: 0;
    color: var(--crema);
}

.panel-historial-cab .boton-chip {
    background-color: transparent;
    color: var(--crema);
    border-color: var(--crema);
}

.panel-historial-cab .boton-chip:hover {
    background-color: rgba(253, 251, 247, 0.15);
    color: var(--crema);
}

.area-conversacion {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
    background-color: var(--crema);
}

/* ============================================
   AVATAR — Don Emilio (Rol 4)
   ============================================ */

#contenedor-avatar {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 38%, #E7ECF6 0%, #CCD7E9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(42, 33, 30, 0.14);
    transition: background 0.5s ease, box-shadow 0.5s ease;
    margin: 0 auto;
    flex-shrink: 0;
}

.rostro {
    width: 190px;
    height: 200px;
    background: linear-gradient(180deg, #F3CDA9 0%, #EFC29C 100%);
    border-radius: 50%;
    position: relative;
    margin-top: 10px;
    box-shadow: inset 0 -6px 14px rgba(150, 90, 50, 0.12);
}

.oreja {
    position: absolute;
    width: 26px;
    height: 34px;
    background: #EDBF93;
    border-radius: 50% 50% 50% 50% / 62% 62% 42% 42%;
    top: 96px;
    z-index: 3;
    box-shadow: inset 0 0 4px rgba(150, 90, 50, 0.22);
}

.oreja.izquierda {
    left: -12px;
}

.oreja.derecha {
    right: -12px;
}

/* Detalle interno de la oreja (concha) */
.oreja::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 19px;
    background: #D6A377;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: inset 1px 1px 2px rgba(120, 70, 40, 0.35);
}

/* Calvo arriba, con cabello plateado en los laterales */
.cabello {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.cabello::before,
.cabello::after {
    content: '';
    position: absolute;
    top: 54px;
    width: 30px;
    height: 88px;
    background: linear-gradient(160deg, #FCFCFC 18%, #CCCCCC 100%);
    box-shadow: inset 0 -8px 12px rgba(0, 0, 0, 0.06);
}

.cabello::before {
    left: -6px;
    border-radius: 72% 28% 24% 76% / 42% 30% 70% 58%;
}

.cabello::after {
    right: -6px;
    border-radius: 28% 72% 76% 24% / 30% 42% 58% 70%;
}

/* Barba plateada — calidez de abuelo */
.barba {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 58px;
    z-index: 1;
    background: linear-gradient(180deg, #F1F1F1 0%, #D2D2D2 100%);
    border-radius: 40% 40% 48% 48% / 24% 24% 96% 96%;
    box-shadow: inset 0 5px 10px rgba(255, 255, 255, 0.5);
}

.cejas {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 122px;
    display: flex;
    justify-content: space-between;
    z-index: 6;
}

.ceja {
    width: 36px;
    height: 7px;
    background: #D2CABD;
    border-radius: 6px;
    transition: transform 0.45s ease, background 0.45s ease;
}

.ojos {
    position: absolute;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    width: 116px;
    display: flex;
    justify-content: space-between;
    z-index: 3;
}

.ojo {
    width: 30px;
    height: 30px;
    background: #FFFFFF;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.10);
    transition: all 0.45s ease;
}

.pupila {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #4A3524;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.ojo::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    top: 6px;
    left: 8px;
    transition: all 0.45s ease;
}

@keyframes parpadeo {

    0%,
    86%,
    100% {
        transform: scaleY(1);
    }

    93% {
        transform: scaleY(0.06);
    }
}

.parpadeando .ojo {
    animation: parpadeo 0.2s ease;
}

/* Parpadeo automático esporádico (dos parpadeos por ciclo, ritmo irregular) */
@keyframes parpadeo-auto {
    0%, 41%, 47%, 89%, 100% {
        transform: scaleY(1);
    }
    44%, 92% {
        transform: scaleY(0.08);
    }
}

#contenedor-avatar .ojo {
    animation: parpadeo-auto 7s ease-in-out infinite;
}

/* Al hablar (o estando alegre) los ojos permanecen abiertos, sin parpadear */
#contenedor-avatar.agente-hablando .ojo,
#contenedor-avatar.emocion-alegre .ojo {
    animation: none;
}

/* Gafas redondas — símbolo de confianza y sabiduría */
.gafas {
    position: absolute;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    width: 132px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    z-index: 5;
}

.lente {
    position: relative;
    width: 48px;
    height: 46px;
    border-radius: 50%;
    border: 4px solid #4A3A2A;
    background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.16) 34%, rgba(205, 222, 232, 0.10) 62%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 0 5px rgba(255, 255, 255, 0.35);
}

/* Reflejo del cristal */
.lente::after {
    content: '';
    position: absolute;
    top: 7px;
    left: 9px;
    width: 15px;
    height: 9px;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    transform: rotate(-25deg);
}

/* Patillas hacia las orejas */
.lente.izquierda::before,
.lente.derecha::before {
    content: '';
    position: absolute;
    top: 11px;
    width: 20px;
    height: 4px;
    background: #4A3A2A;
    border-radius: 2px;
}

.lente.izquierda::before {
    left: -19px;
    transform: rotate(8deg);
    transform-origin: right center;
}

.lente.derecha::before {
    right: -19px;
    transform: rotate(-8deg);
    transform-origin: left center;
}

/* Puente que conecta ambos lentes (solapa 5px en cada uno para unir bien) */
.puente {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 46px;
    height: 11px;
    background: transparent;
    border-top: 4px solid #4A3A2A;
    border-radius: 55% 55% 0 0 / 90% 90% 0 0;
}

@keyframes hablar {
    0% {
        transform: translateX(-50%) scaleY(0.85);
    }

    25% {
        transform: translateX(-50%) scaleY(0.30);
    }

    50% {
        transform: translateX(-50%) scaleY(0.95);
    }

    75% {
        transform: translateX(-50%) scaleY(0.25);
    }

    100% {
        transform: translateX(-50%) scaleY(0.85);
    }
}

#contenedor-avatar.agente-hablando .boca {
    animation: hablar 0.55s ease-in-out infinite;
}

/* Al pausar el audio, la gesticulación se congela en el punto donde iba */
#contenedor-avatar.agente-hablando.voz-pausada .boca {
    animation-play-state: paused;
}

.nariz {
    position: absolute;
    top: 116px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 18px;
    background: #E3B084;
    border-radius: 45% 45% 50% 50%;
    z-index: 2;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.06);
}

.mejilla {
    position: absolute;
    width: 30px;
    height: 16px;
    background: rgba(232, 130, 120, 0.30);
    border-radius: 50%;
    top: 126px;
    z-index: 2;
    transition: all 0.45s ease;
}

.mejilla.izquierda {
    left: 16px;
}

.mejilla.derecha {
    right: 16px;
}

/* Bigote plateado */
.bigote {
    position: absolute;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    width: 78px;
    height: 24px;
    background: linear-gradient(180deg, #F0F0F0, #D6D6D6);
    border-radius: 46% 46% 50% 50% / 30% 30% 90% 90%;
    z-index: 4;
    box-shadow: inset 0 3px 4px rgba(255, 255, 255, 0.6);
}

.boca {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 14px;
    background: #C97C6E;
    border-radius: 0 0 24px 24px;
    transition: all 0.45s ease;
    z-index: 3;
    animation: respirar 4s ease-in-out infinite;
}

/* Respiración suave: leve movimiento de la boca en reposo */
@keyframes respirar {
    0%, 100% {
        transform: translateX(-50%) scaleY(1);
    }
    50% {
        transform: translateX(-50%) scaleY(1.16);
    }
}

/* --- EMOCIONES --- */

#contenedor-avatar.emocion-neutral {
    background: radial-gradient(circle at 50% 38%, #E7ECF6 0%, #CCD7E9 100%);
    box-shadow: 0 10px 30px rgba(42, 33, 30, 0.14);
}

#contenedor-avatar.emocion-alegre {
    background: radial-gradient(circle at 50% 38%, #FBEBC0 0%, #F6DDA0 100%);
    box-shadow: 0 10px 30px rgba(212, 165, 116, 0.22);
}

.emocion-alegre .ceja.izquierda {
    transform: rotate(-14deg);
    transform-origin: left center;
}

.emocion-alegre .ceja.derecha {
    transform: rotate(14deg);
    transform-origin: right center;
}

.emocion-alegre .ojo {
    background: transparent;
    box-shadow: none;
    border-bottom: 4px solid #4A3524;
    border-radius: 0 0 50% 50%;
    height: 15px;
    width: 30px;
}

.emocion-alegre .ojo::after {
    display: none;
}

.emocion-alegre .pupila {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

.emocion-alegre .mejilla {
    background: rgba(232, 110, 100, 0.45);
    width: 36px;
    height: 22px;
}

.emocion-alegre .boca {
    width: 52px;
    height: 26px;
    background: #B85F52;
    border-radius: 0 0 26px 26px;
    border-top: 3px solid #9A4C41;
}

#contenedor-avatar.emocion-triste {
    background: radial-gradient(circle at 50% 38%, #D3E0EE 0%, #BBCFE4 100%);
    box-shadow: 0 10px 30px rgba(33, 90, 150, 0.16);
}

.emocion-triste .ceja.izquierda {
    transform: rotate(14deg);
    transform-origin: right center;
}

.emocion-triste .ceja.derecha {
    transform: rotate(-14deg);
    transform-origin: left center;
}

.emocion-triste .ojo {
    height: 26px;
    width: 28px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.14);
}

.emocion-triste .pupila {
    width: 9px;
    height: 9px;
    top: 58%;
}

.emocion-triste .ojo::after {
    display: none;
}

.emocion-triste .mejilla {
    background: rgba(150, 160, 185, 0.22);
    width: 26px;
    height: 14px;
}

.emocion-triste .boca {
    width: 36px;
    height: 14px;
    background: #B07268;
    border-radius: 24px 24px 0 0;
}

#contenedor-avatar.emocion-sorprendido {
    background: radial-gradient(circle at 50% 38%, #E7DAEE 0%, #D6BEE4 100%);
    box-shadow: 0 10px 30px rgba(120, 60, 160, 0.18);
}

.emocion-sorprendido .ceja.izquierda {
    transform: translateY(-9px);
}

.emocion-sorprendido .ceja.derecha {
    transform: translateY(-9px);
}

.emocion-sorprendido .ojo {
    width: 36px;
    height: 36px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.14);
}

.emocion-sorprendido .pupila {
    width: 8px;
    height: 8px;
    background: #33241A;
}

.emocion-sorprendido .ojo::after {
    width: 7px;
    height: 7px;
    top: 6px;
    left: 9px;
}

.emocion-sorprendido .mejilla {
    opacity: 0;
}

.emocion-sorprendido .boca {
    width: 24px;
    height: 24px;
    background: #C97C6E;
    border-radius: 50%;
    border: none;
}

/* --- GLOBO DE DIÁLOGO (voz del agente) --- */

#subtitulos-agente {
    position: relative;
    width: 100%;
    max-width: 640px;
    min-height: 96px;
    max-height: 34vh;
    overflow-y: auto;
    background-color: #FFFFFF;
    border: 3px solid var(--verde);
    border-radius: 22px;
    padding: 22px 28px;
    font-size: 27px;
    line-height: 1.55;
    color: var(--tinta);
    text-align: left;
    word-wrap: break-word;
    box-shadow: 0 10px 30px rgba(42, 33, 30, 0.10);
}

/* Puntero del globo apuntando a la izquierda, hacia el rostro de Emilio */
#subtitulos-agente::before {
    content: "";
    position: absolute;
    top: 60px;
    left: -18px;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    border-right: 18px solid var(--verde);
}

#subtitulos-agente::after {
    content: "";
    position: absolute;
    top: 61px;
    left: -13px;
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
    border-right: 14px solid #FFFFFF;
}

/* --- BOTONES DE PRUEBA --- */

.botones-prueba {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 8px;
}

.botones-prueba button {
    padding: 5px 10px;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    color: #1C1C1C;
    background: #EAEAEA;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    min-height: auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.botones-prueba button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
}

.botones-prueba button:active {
    transform: scale(0.97);
}

.botones-prueba button[data-emocion="neutral"] {
    background: #C8E6C9;
}

.botones-prueba button[data-emocion="alegre"] {
    background: #FFECB3;
}

.botones-prueba button[data-emocion="triste"] {
    background: #BBDEFB;
}

.botones-prueba button[data-emocion="sorprendido"] {
    background: #E1BEE7;
}

.botones-prueba button.activo {
    outline: 3px solid #1C1C1C;
    outline-offset: 2px;
}

/* ============================================
   RESPONSIVIDAD
   ============================================ */

@media (max-width: 768px) {
    body {
        font-size: 22px;
    }

    h1 {
        font-size: 36px;
    }

    h2 {
        font-size: 28px;
    }

    h3 {
        font-size: 24px;
    }

    p {
        font-size: 22px;
    }

    button {
        font-size: 20px;
        padding: 14px 24px;
        min-height: 54px;
    }

    .boton-principal {
        font-size: 24px;
        min-height: 60px;
        padding: 16px 32px;
    }

    /* --- Sala de conversación en móvil --- */
    .sala-barra {
        padding: 10px 16px;
    }

    .sala-marca h1 {
        font-size: 22px;
    }

    .sala-acciones {
        gap: 8px;
    }

    .boton-chip {
        font-size: 15px;
        padding: 8px 14px;
    }

    /* En móvil se vuelve a apilar: Emilio arriba, su voz debajo */
    .sala-escenario {
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .sala-escenario #contenedor-avatar {
        width: 190px;
        height: 190px;
    }

    .escena-dialogo {
        align-items: center;
        max-width: 100%;
        width: 100%;
    }

    .sala-escenario .estado-sistema {
        align-self: center;
    }

    #subtitulos-agente {
        font-size: 22px;
        padding: 16px 18px;
        max-height: 30vh;
        text-align: center;
    }

    /* El puntero vuelve a apuntar hacia arriba (al avatar) */
    #subtitulos-agente::before {
        top: -18px;
        left: 50%;
        transform: translateX(-50%);
        border-top: 0;
        border-left: 16px solid transparent;
        border-right: 16px solid transparent;
        border-bottom: 18px solid var(--verde);
    }

    #subtitulos-agente::after {
        top: -13px;
        left: 50%;
        transform: translateX(-50%);
        border-top: 0;
        border-left: 13px solid transparent;
        border-right: 13px solid transparent;
        border-bottom: 14px solid #FFFFFF;
    }

    .sala-entrada {
        padding: 10px 14px 14px;
    }

    .barra-entrada {
        gap: 8px;
        flex-wrap: wrap;
    }

    .barra-entrada .boton-microfono {
        flex: 1 1 100%;
        order: -1;
    }

    .barra-entrada input {
        flex: 1 1 auto;
        font-size: 20px;
    }
}

@media (max-width: 500px) {
    /* En móvil se escala el rostro completo (gafas y barba incluidas) */
    #contenedor-avatar {
        width: 190px;
        height: 190px;
    }

    .rostro {
        transform: scale(0.72);
    }

    #subtitulos-agente {
        font-size: 22px;
        padding: 12px 14px;
    }

    .botones-prueba button {
        font-size: 12px;
        padding: 5px 12px;
    }
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 4px solid var(--color-acento);
    outline-offset: 4px;
}

@media (prefers-contrast: more) {
    button {
        border-width: 4px;
    }

    input,
    textarea {
        border-width: 4px;
    }

}

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

/* ============================================
   MODO OSCURO
   ============================================ */

@media (prefers-color-scheme: dark) {
    body {
        background-color: #FAF8F3;
        color: var(--granate);
    }

    input[type="text"],
    input[type="password"],
    textarea {
        background-color: #FAF8F3;
        border-color: var(--granate);
        color: var(--granate);
    }

    .area-conversacion {
        background-color: #FAF8F3;
        border-color: var(--granate);
    }

    .mensaje-usuario {
        background-color: var(--crema-usuario);
    }

    .mensaje-agente {
        background-color: var(--crema-tarjeta);
    }
}

/* ============================================
   IMPRESIÓN
   ============================================ */

@media print {
    body {
        background-color: #FAF8F3;
        color: var(--granate);
    }

    button,
    input,
    textarea {
        display: none;
    }
}

/* ============================================
   TINTA DE LECTURA
   Los bloques de texto largo se muestran en un casi-negro cálido
   (--tinta) para máxima comodidad visual de los adultos mayores.
   Títulos, etiquetas y elementos de marca conservan el granate.
   ============================================ */

body,
p,
label,
.mensaje p,
.estado-sistema,
.estado-sistema p {
    color: var(--tinta);
}

/* ============================================================
   PANTALLA DE BIENVENIDA — HERO DE DOS PANELES (rediseño)
   Izquierda: Emilio se presenta.  Derecha: información + acceso.
   ============================================================ */

.bienvenida {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ── Panel izquierdo: presentación de Emilio ─────────────────── */

.bienvenida-hero {
    flex: 0 0 44%;
    max-width: 44%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
    color: var(--crema);
    background:
        radial-gradient(circle at 28% 18%, rgba(212, 165, 116, 0.22), transparent 55%),
        linear-gradient(160deg, var(--granate) 0%, var(--granate-oscuro) 100%);
    border-right: 6px solid var(--dorado);
    border-image: linear-gradient(180deg, var(--granate) 0%, var(--dorado) 50%, var(--verde) 100%) 1;
}

.hero-contenido {
    position: relative;
    z-index: 1;
    max-width: 460px;
    text-align: center;
}

.avatar-saludo {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    position: relative;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.18), 0 20px 45px rgba(0, 0, 0, 0.30);
}

.hero-etiqueta {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 17px;
    font-weight: bold;
    color: var(--dorado);
    margin-bottom: 8px;
}

.hero-saludo {
    font-size: 52px;
    line-height: 1.1;
    color: var(--crema);
    margin-bottom: 16px;
}

.hero-texto {
    font-size: 23px;
    line-height: 1.6;
    color: rgba(253, 251, 247, 0.92);
    margin-bottom: 32px;
}

/* ── Botón de información del proyecto (reemplaza la línea de universidades) ── */
.hero-info-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    padding: 15px 30px;
    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    color: var(--crema);
    background: rgba(255, 255, 255, 0.10);
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}

.hero-info-btn:hover {
    background: rgba(255, 255, 255, 0.20);
    border-color: #ffffff;
    transform: translateY(-2px);
}

.hero-info-btn:focus-visible {
    outline: 3px solid var(--dorado);
    outline-offset: 3px;
}

.hero-info-icono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    color: var(--dorado);
}

/* ── Modal: Información del Proyecto ─────────────────────────── */
.modal-info {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(42, 33, 30, 0.58);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: aparecerModal 0.25s ease;
}

.modal-info.oculto {
    display: none;
}

@keyframes aparecerModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-info-caja {
    width: min(600px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--crema);
    border: 1px solid var(--crema-tarjeta);
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.modal-info-cab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 30px 20px;
    border-bottom: 1px solid var(--crema-tarjeta);
}

.modal-info-marca {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-info-sello {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 24px;
    font-weight: 700;
    color: var(--crema);
    background: var(--granate);
    border-radius: 50%;
    flex-shrink: 0;
}

.modal-info-cab h2 {
    font-family: 'Merriweather', serif;
    font-size: 24px;
    color: var(--granate);
    margin: 0;
}

.modal-info-cerrar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 20px;
    color: var(--tinta);
    background: var(--crema-tarjeta);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.modal-info-cerrar:hover {
    background: var(--crema-usuario);
}

.modal-info-cerrar:focus-visible {
    outline: 3px solid var(--granate);
    outline-offset: 2px;
}

.modal-info-cuerpo {
    padding: 24px 30px 8px;
}

.modal-info-bloque {
    padding: 18px 20px;
    margin-bottom: 18px;
    background: var(--crema-tarjeta);
    border-radius: 16px;
    border-left: 5px solid var(--dorado);
}

.modal-info-bloque h3 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--granate);
    margin: 0 0 8px;
}

.modal-info-bloque p {
    font-size: 17px;
    line-height: 1.55;
    color: var(--tinta);
    margin: 0 0 8px;
}

.modal-info-bloque p:last-child {
    margin-bottom: 0;
}

.modal-info-dest {
    font-size: 21px !important;
    font-weight: 700;
    color: var(--tinta);
}

.modal-info-legal {
    font-size: 15px !important;
    color: rgba(42, 33, 30, 0.72);
}

.modal-info-instituciones {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.institucion {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--crema);
    border: 1px solid var(--crema-usuario);
    border-radius: 12px;
}

.institucion-escudo {
    display: inline-block;
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: #FFFFFF;
    border: 1px solid var(--crema-usuario);
    border-radius: 50%;
    padding: 4px;
    flex-shrink: 0;
}

.institucion-nombre {
    font-size: 16px;
    font-weight: 700;
    color: var(--tinta);
    line-height: 1.3;
}

.modal-info-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: var(--crema-tarjeta);
    border-radius: 16px;
    font-size: 16px;
    color: var(--tinta);
}

.modal-info-meta strong {
    color: var(--granate);
}

.modal-info-pie {
    display: flex;
    justify-content: flex-end;
    padding: 8px 30px 28px;
}

.modal-info-pie .boton-principal {
    min-width: 180px;
}

/* ── Panel derecho: información + acceso ─────────────────────── */

.bienvenida-panel {
    flex: 1 1 56%;
    height: 100vh;
    overflow-y: auto;
    background: var(--crema);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 44px;
}

.panel-contenido {
    width: 100%;
    max-width: 660px;
}

.panel-titulo {
    font-size: 32px;
    color: var(--granate);
    margin-bottom: 4px;
}

.panel-intro {
    font-size: 18px;
    color: var(--tinta);
    margin-bottom: 16px;
}

/* Tarjetas informativas con icono — fila horizontal en pantallas amplias */

.tarjetas-info {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.tarjeta {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    background: #FFFFFF;
    border: 2px solid #E7DECF;
    border-top: 6px solid var(--granate);
    border-radius: 14px;
    padding: 14px 12px;
    box-shadow: 0 4px 14px rgba(42, 33, 30, 0.05);
}

.tarjeta.acento-granate {
    border-top-color: var(--granate);
}

.tarjeta.acento-verde {
    border-top-color: var(--verde);
}

.tarjeta.acento-dorado {
    border-top-color: var(--dorado);
}

.tarjeta-icono {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    background: var(--crema-tarjeta);
    border-radius: 50%;
}

.tarjeta-texto strong {
    display: block;
    font-size: 16px;
    color: var(--granate);
    margin-bottom: 2px;
}

.tarjeta-texto p {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 0;
    color: var(--tinta);
}

/* Fila de consentimiento */

.fila-consentimiento {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--crema-tarjeta);
    border: 2px solid var(--dorado);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 17px;
    line-height: 1.4;
    color: var(--tinta);
    cursor: pointer;
}

.fila-consentimiento input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    transform: scale(1.15);
}

.fila-consentimiento span {
    flex: 1;
}

/* Campos del formulario — en fila sobre pantallas amplias */

.fila-campos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 16px;
}

.campo-form {
    margin-bottom: 0;
}

.campo-form label {
    display: block;
    font-size: 17px;
    font-weight: bold;
    color: var(--granate);
    margin-bottom: 6px;
}

.campo-form small {
    display: block;
    font-size: 13px;
    color: #6B6B6B;
    line-height: 1.35;
    margin-top: 5px;
}

.campo-form small a {
    color: var(--verde-oscuro);
    font-weight: bold;
}

/* Selector de trato (Don / Doña) — evita que se asuma el género de la persona */

.selector-trato {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.selector-trato-etiqueta {
    font-size: 13px;
    color: #6B6B6B;
    margin-right: 2px;
}

.chip-trato {
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    color: var(--tinta);
    background: #FFFFFF;
    border: 3px solid var(--color-borde);
    border-radius: 10px;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip-trato:hover {
    border-color: var(--granate);
}

.chip-trato[aria-checked="true"] {
    background: var(--granate);
    border-color: var(--granate);
    color: #FFFFFF;
}

.chip-trato:focus-visible {
    outline: 3px solid var(--color-acento);
    outline-offset: 2px;
}

/* Botón de acceso */

.boton-comenzar {
    width: 100%;
    font-size: 22px;
    padding: 16px;
    border-radius: 12px;
    margin-top: 2px;
}

.boton-comenzar:not(:disabled)::after {
    content: "→";
    font-size: 28px;
}

.panel-credito {
    text-align: center;
    font-size: 15px;
    color: #9A9A9A;
    margin-top: 24px;
    margin-bottom: 0;
}

/* ── Responsividad del hero de bienvenida ───────────────────── */

@media (max-width: 900px) {
    .bienvenida {
        flex-direction: column;
        height: 100vh;
        overflow-y: auto;
    }

    .bienvenida-hero {
        flex: none;
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 32px 24px;
        border-right: none;
        border-bottom: 6px solid var(--dorado);
        border-image: linear-gradient(90deg, var(--granate) 0%, var(--dorado) 50%, var(--verde) 100%) 1;
    }

    .bienvenida-panel {
        height: auto;
        overflow: visible;
        align-items: flex-start;
        padding: 32px 24px 48px;
    }

    .panel-titulo {
        font-size: 36px;
    }

    .panel-intro {
        font-size: 20px;
        margin-bottom: 24px;
    }

    .tarjetas-info {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 28px;
    }

    .tarjeta {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: 16px;
        padding: 16px 20px;
        border-top: none;
        border-left: 7px solid var(--granate);
    }

    .tarjeta.acento-granate { border-left-color: var(--granate); border-top: none; }
    .tarjeta.acento-verde { border-left-color: var(--verde); border-top: none; }
    .tarjeta.acento-dorado { border-left-color: var(--dorado); border-top: none; }

    .tarjeta-icono {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }

    .tarjeta-texto strong {
        font-size: 20px;
    }

    .tarjeta-texto p {
        font-size: 17px;
    }

    .fila-consentimiento {
        font-size: 19px;
        padding: 18px 20px;
        margin-bottom: 24px;
    }

    .fila-campos {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }

    .campo-form label {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .campo-form small {
        font-size: 15px;
    }

    .input-apikey,
    .input-nombre {
        font-size: 21px;
        padding: 14px 16px;
    }

    .selector-trato-etiqueta {
        font-size: 16px;
    }

    .chip-trato {
        font-size: 19px;
        padding: 10px 22px;
    }

    .boton-comenzar {
        font-size: 24px;
        padding: 18px;
    }

    .avatar-saludo {
        width: 180px;
        height: 180px;
        margin-bottom: 20px;
    }

    .avatar-saludo .rostro {
        transform: scale(0.72);
    }

    .hero-saludo {
        font-size: 40px;
    }

    .hero-texto {
        font-size: 20px;
        margin-bottom: 22px;
    }
}

@media (max-width: 500px) {
    .bienvenida-hero {
        padding: 24px 16px;
    }

    .avatar-saludo {
        width: 150px;
        height: 150px;
    }

    .avatar-saludo .rostro {
        transform: scale(0.6);
    }

    .hero-etiqueta {
        font-size: 14px;
        letter-spacing: 2px;
    }

    .hero-saludo {
        font-size: 32px;
    }

    .panel-titulo {
        font-size: 30px;
    }

    .bienvenida-panel {
        padding: 24px 16px 40px;
    }

    .tarjeta {
        padding: 14px 16px;
        gap: 12px;
    }

    .tarjeta-icono {
        width: 46px;
        height: 46px;
        font-size: 26px;
    }

    .tarjeta-texto strong {
        font-size: 20px;
    }

    .tarjeta-texto p {
        font-size: 17px;
    }

    .fila-consentimiento {
        font-size: 19px;
        padding: 16px;
    }
}