/* ============================================
   App del evento · Interseccionalidad en juego
   Identidad: Bizkaia Gazteak
   Fondo blanco, Lato, gris #585857, rojo #B31218
   ============================================ */

@font-face {
    font-family: 'Lato';
    src: url('../fonts/lato-light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url('../fonts/lato-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url('../fonts/lato-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-fondo: #FFFFFF;
    --color-primario: #B31218;
    --color-texto: #585857;
    --color-texto-sec: #888887;
    --color-exito: #2E7D32;
    --color-alerta: #E65100;
    --color-borde: #D0D0D0;
    --color-fondo-card: #F5F5F5;
    --radio-boton: 10px;
    --min-alto-boton: 52px;
    --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--color-fondo);
    color: var(--color-texto);
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-primario); border-radius: 4px; }

/* =============================================
   ANIMACIONES
   ============================================= */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(30px) scale(0.8); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.animate-in {
    animation: fadeUp 0.6s var(--ease-expo) forwards;
    opacity: 0;
}
.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }
.animate-in:nth-child(7) { animation-delay: 0.35s; }
.animate-in:nth-child(8) { animation-delay: 0.4s; }
.animate-in:nth-child(9) { animation-delay: 0.45s; }
.animate-in:nth-child(10) { animation-delay: 0.5s; }

/* =============================================
   CONTENEDOR
   ============================================= */
.contenedor {
    max-width: 480px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* =============================================
   LOGO
   ============================================= */
.logo {
    display: block;
    max-width: 180px;
    margin: 0 auto 2rem;
}

/* =============================================
   TITULOS
   ============================================= */
h1 {
    font-family: 'Lato', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--color-texto);
    letter-spacing: -0.01em;
}

h2 {
    font-family: 'Lato', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--color-texto);
}

h3 {
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-texto-sec);
    margin-bottom: 0.5rem;
}

/* =============================================
   BOTON PRINCIPAL (rojo Bizkaia Gazteak)
   ============================================= */
.boton-magenta {
    display: block;
    width: 100%;
    min-height: var(--min-alto-boton);
    padding: 16px 1.5rem;
    background: var(--color-primario);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radio-boton);
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s var(--ease-expo);
    box-shadow: 0 2px 8px rgba(179, 18, 24, 0.2);
}

.boton-magenta:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(179, 18, 24, 0.3);
}

.boton-magenta:active {
    transform: scale(0.97);
}

.boton-magenta:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =============================================
   BOTON SECUNDARIO
   ============================================= */
.boton-secundario {
    display: block;
    width: 100%;
    min-height: var(--min-alto-boton);
    padding: 14px 1.5rem;
    background: transparent;
    color: var(--color-texto);
    border: 1.5px solid var(--color-borde);
    border-radius: var(--radio-boton);
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s var(--ease-expo);
}

.boton-secundario:active {
    border-color: var(--color-primario);
    color: var(--color-primario);
}

/* =============================================
   BOTON TOGGLE
   ============================================= */
.boton-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: var(--min-alto-boton);
    padding: 14px 18px;
    background: transparent;
    color: var(--color-texto);
    border: 1.5px solid var(--color-borde);
    border-radius: 10px;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s var(--ease-expo);
}

.boton-toggle:active {
    transform: scale(0.97);
}

.boton-toggle.activo {
    border-color: var(--color-primario);
    background: rgba(179, 18, 24, 0.06);
}

.boton-toggle .icono {
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-expo);
}

.boton-toggle.activo .icono {
    animation: pulse 0.3s var(--ease-expo);
}

/* =============================================
   SELECT / DESPLEGABLE
   ============================================= */
.select-asistente {
    width: 100%;
    min-height: var(--min-alto-boton);
    padding: 14px 1rem;
    background: var(--color-fondo);
    color: var(--color-texto);
    border: 1.5px solid var(--color-borde);
    border-radius: 10px;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23B31218' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    transition: all 0.3s var(--ease-expo);
}

.select-asistente:focus {
    outline: none;
    border-color: var(--color-primario);
    box-shadow: 0 0 0 3px rgba(179, 18, 24, 0.1);
}

/* =============================================
   INPUT TEXTO
   ============================================= */
.input-texto {
    width: 100%;
    min-height: var(--min-alto-boton);
    padding: 14px 1rem;
    background: var(--color-fondo);
    color: var(--color-texto);
    border: 1.5px solid var(--color-borde);
    border-radius: 10px;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    transition: all 0.3s var(--ease-expo);
}

.input-texto:focus {
    outline: none;
    border-color: var(--color-primario);
    box-shadow: 0 0 0 3px rgba(179, 18, 24, 0.1);
}

.input-texto::placeholder {
    color: var(--color-texto-sec);
}

/* =============================================
   BARRA DE BUSQUEDA
   ============================================= */
.barra-busqueda {
    width: 100%;
    min-height: var(--min-alto-boton);
    padding: 14px 1rem 14px 2.75rem;
    background: var(--color-fondo);
    color: var(--color-texto);
    border: 1.5px solid var(--color-borde);
    border-radius: 10px;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23585857' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.85rem center;
    transition: all 0.3s var(--ease-expo);
}

.barra-busqueda:focus {
    outline: none;
    border-color: var(--color-primario);
    box-shadow: 0 0 0 3px rgba(179, 18, 24, 0.1);
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--color-fondo-card);
    border: 1px solid var(--color-borde);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s var(--ease-expo);
}

/* =============================================
   LISTA DE PERSONAS
   ============================================= */
.lista-personas {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.persona-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--color-fondo-card);
    border: 1px solid var(--color-borde);
    border-left: 3px solid var(--color-primario);
    border-radius: 10px;
    transition: all 0.3s var(--ease-expo);
    animation: fadeUp 0.5s var(--ease-expo) forwards;
    opacity: 0;
}

.persona-item:nth-child(1) { animation-delay: 0.05s; }
.persona-item:nth-child(2) { animation-delay: 0.1s; }
.persona-item:nth-child(3) { animation-delay: 0.15s; }
.persona-item:nth-child(4) { animation-delay: 0.2s; }
.persona-item:nth-child(5) { animation-delay: 0.25s; }
.persona-item:nth-child(6) { animation-delay: 0.3s; }
.persona-item:nth-child(7) { animation-delay: 0.35s; }
.persona-item:nth-child(8) { animation-delay: 0.4s; }
.persona-item:nth-child(9) { animation-delay: 0.45s; }
.persona-item:nth-child(10) { animation-delay: 0.5s; }

.persona-nombre {
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-texto);
}

.persona-empresa {
    font-size: 0.8rem;
    color: var(--color-texto-sec);
    margin-top: 2px;
}

/* =============================================
   NUMERO DE MESA GRANDE
   ============================================= */
.mesa-grande {
    font-family: 'Lato', sans-serif;
    font-size: 8rem;
    font-weight: 700;
    text-align: center;
    line-height: 1;
    margin: 1.5rem 0;
    animation: countUp 0.8s var(--ease-expo) forwards;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    height: 1.2em;
    border-radius: 20px;
    margin-left: auto;
    margin-right: auto;
    color: #FFFFFF;
}

#pantalla-mesa .texto-centro + .mesa-grande {
    display: flex;
    margin-left: auto;
    margin-right: auto;
}

/* Colores de mesa: 10 colores distinguibles, siempre con numero */
.mesa-1 { background: #B31218; }
.mesa-2 { background: #1565C0; }
.mesa-3 { background: #2E7D32; }
.mesa-4 { background: #F57F17; }
.mesa-5 { background: #6A1B9A; }
.mesa-6 { background: #00838F; }
.mesa-7 { background: #D84315; }
.mesa-8 { background: #283593; }
.mesa-9 { background: #4E342E; }
.mesa-10 { background: #37474F; }

/* =============================================
   CONTADOR
   ============================================= */
.contador {
    text-align: center;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    color: var(--color-texto-sec);
    padding: 0.75rem;
}

.contador strong {
    font-weight: 700;
    color: var(--color-primario);
    font-size: 1.1em;
}

/* =============================================
   CRONOMETRO
   ============================================= */
.cronometro {
    font-family: 'Lato', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--color-primario);
    margin: 1rem 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

/* =============================================
   PANTALLAS
   ============================================= */
.pantalla {
    display: none;
    animation: fadeIn 0.5s var(--ease-expo);
}

.pantalla.activa {
    display: block;
}

/* =============================================
   MATCH MUTUO
   ============================================= */
.match-mutuo {
    border-color: var(--color-exito) !important;
    border-left-color: var(--color-exito) !important;
    background: rgba(46, 125, 50, 0.05);
}

/* =============================================
   MENSAJE DE ESPERA
   ============================================= */
.mensaje-espera {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-texto-sec);
    animation: fadeUp 0.6s var(--ease-expo) forwards;
}

.mensaje-espera .icono-grande {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
}

/* =============================================
   FORMULARIO
   ============================================= */
.formulario-grupo {
    margin-bottom: 1.25rem;
}

.formulario-grupo label {
    display: block;
    font-family: 'Lato', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-texto-sec);
    margin-bottom: 0.35rem;
}

/* =============================================
   CONFIRMACION
   ============================================= */
.confirmacion {
    text-align: center;
    padding: 3rem 1rem;
    animation: scaleIn 0.6s var(--ease-expo) forwards;
}

.confirmacion .icono-check {
    font-size: 3.5rem;
    color: var(--color-exito);
    margin-bottom: 1rem;
}

/* =============================================
   ESPACIADORES
   ============================================= */
.espaciador { height: 1.25rem; }
.espaciador-grande { height: 2.5rem; }

/* =============================================
   UTILIDADES
   ============================================= */
.texto-centro { text-align: center; }
.texto-sec {
    color: var(--color-texto-sec);
    font-family: 'Lato', sans-serif;
    font-weight: 400;
}

.separador {
    border: none;
    border-top: 1px solid var(--color-borde);
    margin: 2rem 0;
}

/* =============================================
   PREGUNTA (cuestionario / dinamicas)
   ============================================= */
.pregunta-grupo {
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-borde);
}

.pregunta-grupo:last-child {
    border-bottom: none;
}

.pregunta-titulo {
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-primario);
}

.pregunta-opciones {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.campo-otro {
    margin-top: 0.5rem;
    display: none;
}

.campo-otro.visible {
    display: block;
    animation: fadeUp 0.3s var(--ease-expo) forwards;
}

.progreso-cuestionario {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--color-primario);
    transition: width 0.5s var(--ease-expo);
    z-index: 100;
}

/* =============================================
   ZONAS DE TRANSICION
   ============================================= */
.zonas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1rem 0;
}

.zona-card {
    background: var(--color-fondo-card);
    border: 1.5px solid var(--color-borde);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s var(--ease-expo);
}

.zona-card.recomendada {
    border-color: var(--color-primario);
    background: rgba(179, 18, 24, 0.04);
}

.zona-icono {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

.zona-nombre {
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
}

/* =============================================
   PUERTA: RESULTADOS BUSQUEDA
   ============================================= */
.persona-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--color-fondo-card);
    border: 1.5px solid var(--color-borde);
    border-radius: 10px;
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: all 0.2s var(--ease-expo);
    -webkit-tap-highlight-color: transparent;
}

.persona-item:active {
    transform: scale(0.97);
    border-color: var(--color-primario);
}

.persona-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.persona-info strong {
    font-size: 1rem;
    color: var(--color-texto);
}

.badge-registrada {
    color: var(--color-exito);
    font-size: 1.3rem;
    font-weight: 700;
}

/* =============================================
   BOTON PRIMARIO (rojo)
   ============================================= */
.boton-primario {
    display: block;
    width: 100%;
    min-height: var(--min-alto-boton);
    padding: 0.75rem 1.5rem;
    background: var(--color-primario);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radio-boton);
    font-family: 'Lato', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s var(--ease-expo);
}

.boton-primario:active {
    transform: scale(0.96);
}

/* =============================================
   MESA GRANDE (pantalla de asignacion)
   ============================================= */
.mesa-grande {
    font-family: 'Lato', sans-serif;
    font-size: 8rem;
    font-weight: 700;
    text-align: center;
    line-height: 1;
    padding: 1.5rem;
    border-radius: 20px;
    color: #FFFFFF;
    margin: 1rem auto;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================
   TABLET: GRID DE MESAS
   ============================================= */
.mesas-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto;
}

.boton-mesa {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    border-radius: 12px;
    font-family: 'Lato', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #FFFFFF;
    cursor: pointer;
    transition: transform 0.2s var(--ease-expo);
}

.boton-mesa:active {
    transform: scale(0.92);
}

/* =============================================
   ESPACIADOR MINI
   ============================================= */
.espaciador-mini {
    height: 0.5rem;
}

/* =============================================
   MENSAJE ESPERA
   ============================================= */
.mensaje-espera {
    text-align: center;
    padding: 3rem 1rem;
}

.mensaje-espera h2 {
    font-size: 1.5rem;
    color: var(--color-texto);
    margin-bottom: 0.5rem;
}

/* =============================================
   DINAMICA 4.1: SLIDER EN TABLET
   ============================================= */
.d41-titulo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-texto);
    line-height: 1.4;
    padding: 0 0.5rem;
}

.d41-valor-display {
    font-size: 5rem;
    font-weight: 700;
    color: var(--color-primario);
    text-align: center;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
}

.d41-unidad {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-texto-sec);
    text-align: center;
    margin-top: 0.25rem;
}

.d41-slider-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0 0.5rem;
}

.d41-slider-min,
.d41-slider-max {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-texto-sec);
    flex-shrink: 0;
    min-width: 2.5rem;
    text-align: center;
}

.d41-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 16px;
    background: var(--color-fondo-card);
    border-radius: 8px;
    border: 2px solid var(--color-borde);
    outline: none;
}

.d41-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 52px;
    height: 52px;
    background: var(--color-primario);
    border-radius: 50%;
    cursor: grab;
    border: 4px solid #FFFFFF;
    box-shadow: 0 2px 12px rgba(179, 18, 24, 0.3);
}

.d41-slider::-moz-range-thumb {
    width: 48px;
    height: 48px;
    background: var(--color-primario);
    border-radius: 50%;
    cursor: grab;
    border: 4px solid #FFFFFF;
    box-shadow: 0 2px 12px rgba(179, 18, 24, 0.3);
}

.d41-slider:active::-webkit-slider-thumb {
    cursor: grabbing;
    transform: scale(1.1);
}

/* =============================================
   ADMIN: BOTON ACREDITAR INLINE
   ============================================= */
.btn-acreditar {
    background: var(--color-primario);
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
}
