/* ==========================================================
   Taquilla VIP - Cine | Estilos generales
   ========================================================== */

body {
    /* Foto de fondo (sala de cine) + degradado de marca encima, para que
       el texto siga siendo legible sobre la foto. La foto queda al 20%
       de presencia aprox. ("80% de transparencia"), pareja en toda la
       página (sin franjas que la tapen).
       Versión horizontal por defecto (tablet/desktop). */
    background-image:
        linear-gradient(135deg, rgba(8,23,53,0.87) 0%, rgba(16,37,82,0.85) 60%, rgba(48,12,20,0.89) 100%),
        url('../img/fondo-desktop.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #ffffff;
    overflow-x: hidden;
}

/* Versión vertical (pantalla de cine) para celulares */
@media (max-width: 767px) {
    body {
        background-image:
            linear-gradient(135deg, rgba(8,23,53,0.87) 0%, rgba(16,37,82,0.85) 60%, rgba(48,12,20,0.89) 100%),
            url('../img/fondo-movil.jpg');
        /* "fixed" (en vez de "scroll") es lo que permite alinear la
           pantalla de cine de la foto justo detrás del botón principal. */
        background-position: center 20%;
    }
}

.gold-gradient-text {
    background: linear-gradient(to right, #FFC400, #FFD752, #FFC400);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-gold {
    background: linear-gradient(135deg, #FFC400 0%, #D4A000 100%);
    box-shadow: 0 4px 15px rgba(255, 196, 0, 0.3);
    transition: all 0.3s ease;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 196, 0, 0.5);
}

.btn-gold:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Estilos específicos para la vista del raspadito */
#scratch-container {
    position: relative;
    width: 100%;
    max-width: 380px;
    min-height: 270px; /* Crece si el contenido necesita más espacio (pantallas angostas) */
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border: 2px solid #FFC400;
}

#scratch-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    background-image: radial-gradient(circle, #2a2a2a 0%, #1a1a1a 100%);
    z-index: 1;
    padding: 20px;
    text-align: center;
}

#pin-box {
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
}

#pin-code {
    /* Tamaño fluido, pero SIN suponer un largo fijo de código: si el
       código real es más largo de lo esperado (o la pantalla es muy
       angosta), se permite pasar a una segunda línea en vez de
       desbordarse o cortarse. Nunca debe salirse de la tarjeta. */
    /* El tope (3er valor) se calculó para la tarjeta (max 380px de ancho),
       no para la pantalla completa: en escritorio, donde la ventana es
       mucho más ancha que la tarjeta, un tope alto se veía enorme y
       amontonado dentro de la misma caja de 380px. */
    font-size: clamp(0.95rem, 5.6vw, 1.7rem);
    letter-spacing: clamp(0.01em, 0.5vw, 0.08em);
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

#scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: pointer;
    /* Evitar comportamientos touch por defecto como scroll al raspar */
    touch-action: none;
}

/* Barra superior (título): dorado, marca "Cinépolis Leopardos" */
.bg-menu-fixed {
    background: linear-gradient(90deg, #FFC400 0%, #D4A000 100%);
}

/* Avisos con forma de boleto de cine: sello a la izquierda (con perforación), texto a la derecha,
   barrita de tiempo abajo. Colores del sitio: azul marino, dorado y rojo cine. */
.aviso-zona {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 400px);
    z-index: 70;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.aviso {
    --acento: #FFC400;
    --acento-fondo: rgba(255, 196, 0, 0.14);
    position: relative;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    pointer-events: auto;
    color: #fff;
    background: linear-gradient(180deg, #132c63 0%, #0b1f48 100%);
    border: 1px solid color-mix(in srgb, var(--acento) 45%, transparent);
    border-radius: 16px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    opacity: 0;
    transform: translateY(-16px) scale(0.97);
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.2, 0.9, 0.25, 1.15);
}
.aviso.show { opacity: 1; transform: none; }
.aviso-error { --acento: #FF5A5F; --acento-fondo: rgba(212, 15, 20, 0.2); }
.aviso-ok { --acento: #3DDC84; --acento-fondo: rgba(61, 220, 132, 0.15); }
.aviso-sello {
    position: relative;
    flex: 0 0 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--acento);
    background: var(--acento-fondo);
    border-right: 2px dashed rgba(255, 255, 255, 0.2);
}
/* Las dos "muescas" del boleto sobre la perforación */
.aviso-sello::before,
.aviso-sello::after {
    content: '';
    position: absolute;
    right: -8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #081735;
    border: 1px solid color-mix(in srgb, var(--acento) 45%, transparent);
}
.aviso-sello::before { top: -8px; }
.aviso-sello::after { bottom: -8px; }
.aviso-cuerpo { flex: 1; min-width: 0; padding: 12px 8px 14px 14px; }
.aviso-titulo { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 15px; color: var(--acento); letter-spacing: 0.01em; }
.aviso-texto { margin-top: 3px; font-size: 13.5px; line-height: 1.4; color: #dbe4f7; overflow-wrap: anywhere; }
.aviso-x {
    align-self: flex-start;
    margin: 8px 8px 0 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: #9fb0d4;
    font-size: 13px;
    cursor: pointer;
}
.aviso-x:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.aviso-barra {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--acento);
    transform-origin: left;
    animation: aviso-barra linear forwards;
}
@keyframes aviso-barra { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
    .aviso { transition: opacity 0.2s ease; transform: none; }
    .aviso-barra { animation: none; display: none; }
}

/* Spinner reutilizable */
.spinner {
    border: 4px solid rgba(255, 196, 0, 0.25);
    border-top-color: #FFC400;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Estado de error en campos de formulario (reemplaza el globo feo nativo
   del navegador por algo con la estética de la página, junto con el toast). */
.input-error {
    border-color: #D40F14 !important;
    animation: input-shake 0.4s ease;
}

@keyframes input-shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-5px); }
    40%, 60% { transform: translateX(5px); }
}

/* Título de la barra superior: letra de marquesina de cine antiguo (art déco).
   El tamaño se ajusta al ancho de la pantalla para que siempre quepa junto al logo. */
.nav-title {
    font-family: 'Limelight', serif;
    font-size: clamp(16px, 5.3vw, 22px);
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.1;
}
@media (min-width: 640px) {
    .nav-title {
        font-size: clamp(22px, 3.6vw, 28px);
    }
}

/* Frase de la barra superior: letra de afiche de cine (Bebas Neue).
   En pantallas grandes va al extremo derecho; en celular, debajo del título. */
.nav-tagline {
    font-family: 'Bebas Neue', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    line-height: 1;
}
.nav-tagline-mobile {
    font-size: clamp(12px, 3.5vw, 14px);
    margin-top: 3px;
}
.nav-tagline-desktop {
    font-size: clamp(17px, 2.7vw, 26px);
}

/* Banner infinito de escuelas con convenio.
   El movimiento lo hace js/escuelas.js (transform en cada cuadro de animación). */
.marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track {
    display: flex;
    gap: 16px;
    width: max-content;
    will-change: transform;
}
/* Todas las tarjetas miden lo mismo y cada logo ya viene normalizado a la
   misma caja (312x160), así que se ven parejos aunque sus formas sean distintas. */
.school-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 192px;
    height: 108px;
    padding: 10px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}
.school-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
}
@media (max-width: 639px) {
    .school-logo {
        width: 160px;
        height: 90px;
        padding: 9px;
    }
}
