/* =========================================================
   IMPORTACIÓN DE FUENTES WEB Y LOCALES
   ========================================================= */

@font-face {
    font-family: 'Mendoline';
    src: url('../fonts/Mendoline.otf') format('opentype'),
         url('../fonts/Mendoline.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* =========================================================
   RESET Y BASE DE LA APLICACIÓN
   ========================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: var(--font-main, 'Montserrat', sans-serif);
    background-color: var(--color-bg, #f4f6f8);
    color: var(--color-text, #333333);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100dvh;
    position: relative;
    overflow-x: hidden;
}

/* Fondo Fijo Inmóvil (Compatible con móviles e iOS) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('../img/fondo.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    pointer-events: none;
}

.main-wrapper {
    width: 100%;
    max-width: 600px;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-md, 16px);
    padding-top: calc(var(--spacing-md, 16px) + var(--safe-top, 0px));
    padding-bottom: calc(var(--spacing-md, 16px) + var(--safe-bottom, 0px));
    box-sizing: border-box;
}

/* Contenedor estándar de tarjeta para el formulario */
.app-container {
    width: 100%;
    max-width: 600px;
    background: var(--color-white, #ffffff);
    border-radius: var(--border-radius, 16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    padding: var(--spacing-lg, 24px);
    margin: 0 auto;
    transition: all 0.3s ease;
}

/* =========================================================
   TIPOGRAFÍAS Y PANTALLAS
   ========================================================= */
h1 { 
    color: var(--color-primary, #1a365d); 
    margin-bottom: var(--spacing-sm, 12px); 
    font-size: 1.6rem; 
    font-weight: 800;
    line-height: 1.3;
}

h2 { 
    color: var(--color-primary, #1a365d); 
    margin-bottom: var(--spacing-md, 16px); 
    font-size: 1.25rem; 
    border-bottom: 2px solid #edf2f7; 
    padding-bottom: 8px; 
}

p { 
    margin-bottom: var(--spacing-lg, 24px); 
    color: #4a5568; 
    font-size: 0.95rem; 
    line-height: 1.6;
}

.screen {
    display: none;
    flex-direction: column;
    width: 100%;
    min-height: calc(100dvh - (var(--spacing-md, 16px) * 2) - var(--safe-top, 0px) - var(--safe-bottom, 0px));
    align-items: center;
    animation: fadeIn 0.4s ease;
    box-sizing: border-box;
}

.screen.active {
    display: flex;
}

/* Centrado vertical seguro: las tarjetas se centran y si crecen expanden hacia arriba y luego hacia abajo */
#screen-welcome .app-container,
#screen-wizard .app-container {
    margin-top: auto;
    margin-bottom: auto;
}

#screen-welcome .logo-container.bottom,
#screen-wizard .logo-container.bottom {
    margin-bottom: auto;
}

/* Pantalla 3: El billete se posiciona en el flujo superior natural */
#screen-ticket {
    min-height: auto;
    justify-content: flex-start;
}

.hidden {
    display: none !important;
}

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

/* =========================================================
   LOGOS
   ========================================================= */
.logo-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 24px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.app-logo {
    width: 90%;
    max-width: 300px;
    height: auto;
    object-fit: contain;
}

/* =========================================================
   PANTALLA 1: BIENVENIDA
   ========================================================= */
#screen-welcome .app-container {
    background: transparent;
    box-shadow: none;
    padding: 0;
    border: none;
}

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

.header-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 20px;
    display: block;
}

#screen-welcome h1 {
    margin-top: 0;
    margin-bottom: 24px;
}

.welcome-content p {
    color: #4a5568;
    font-size: 0.98rem;
    line-height: 1.65;
    margin-bottom: 28px;
}

/* =========================================================
   BOTONES
   ========================================================= */
.btn-primary, .btn-secondary {
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.btn-primary {
    background-color: var(--color-primary, #1a365d);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--color-primary-light, #2b528a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary, #1a365d);
    border: 2px solid var(--color-primary, #1a365d);
    box-shadow: none;
}

.btn-secondary:hover {
    background-color: #f7fafc;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: var(--spacing-lg, 24px);
}

.btn-group button {
    flex: 1;
}

/* =========================================================
   FORMULARIOS Y WIZARD
   ========================================================= */
#checkin-form {
    width: 100%;
}

.input-group { margin-bottom: var(--spacing-md, 16px); text-align: left; }
label { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; color: var(--color-primary, #1a365d); }

input[type="text"], input[type="number"], input[type="tel"], select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    background-color: #ffffff;
}

input:focus, select:focus, textarea:focus { border-color: var(--color-primary, #1a365d); }
textarea { resize: vertical; min-height: 100px; }

.checkbox-group { display: flex; align-items: center; gap: 8px; margin-bottom: var(--spacing-md, 16px); }
.checkbox-group input { width: 20px; height: 20px; cursor: pointer; }
.checkbox-group label { margin-bottom: 0; cursor: pointer; font-size: 1rem; }

.wizard-header { margin-bottom: var(--spacing-lg, 24px); }
.step-indicator { display: block; text-align: center; font-size: 0.85rem; font-weight: 600; color: var(--color-text-light, #718096); margin-bottom: 8px; }
.progress-bar { width: 100%; height: 6px; background-color: #edf2f7; border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; background-color: var(--color-primary, #1a365d); width: 33.33%; transition: width 0.3s ease; }

.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeIn 0.3s ease; }

.nino-card { background-color: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.nino-title { font-size: 0.85rem; font-weight: 700; color: var(--color-primary, #1a365d); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.ninos-container { margin-top: 12px; }

/* =========================================================
   TARJETAS DE DESTINO E INFO
   ========================================================= */
.ticket-content-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.destination-info { margin-top: var(--spacing-xl, 32px); }
.card { background-color: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card h3, .card h4 { color: var(--color-primary, #1a365d); margin-bottom: 8px; font-size: 1.1rem; }
.card p { margin-bottom: 12px; font-size: 0.9rem; }

/* Tarjeta del Salón */
.venue-card {
    text-align: left;
}

.venue-image-container {
    margin: 12px 0 16px 0;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.venue-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

.venue-map-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    padding: 10px;
}

/* Carrusel de Alojamientos */
.carousel-title {
    margin-top: 28px;
    color: var(--color-primary, #1a365d);
    font-size: 1.2rem;
    margin-bottom: 14px;
}

.hotels-carousel {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
    padding-top: 4px;
    -webkit-overflow-scrolling: touch;
}

.hotels-carousel::-webkit-scrollbar {
    height: 6px;
}

.hotels-carousel::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 10px;
}

.hotels-carousel::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.hotel-card {
    flex: 0 0 78%;
    max-width: 250px;
    scroll-snap-align: start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.hotel-image-container {
    position: relative;
    width: 100%;
    height: 125px;
    background-color: #e2e8f0;
}

.hotel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hotel-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(26, 54, 93, 0.88);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.hotel-details {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.hotel-details h4 {
    font-size: 0.95rem;
    color: var(--color-primary, #1a365d);
    margin-bottom: 4px;
    line-height: 1.3;
}

.hotel-time {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 12px;
}

.hotel-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.btn-hotel-link {
    display: block;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-hotel-link.btn-reservar {
    background-color: var(--color-primary, #1a365d);
    color: #ffffff;
    border: 1px solid var(--color-primary, #1a365d);
}

.btn-hotel-link.btn-reservar:hover {
    background-color: var(--color-primary-light, #2b528a);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-hotel-link.btn-maps {
    background-color: transparent;
    color: var(--color-primary, #1a365d);
    border: 1px solid var(--color-primary, #1a365d);
}

.btn-hotel-link.btn-maps:hover {
    background-color: var(--color-primary, #1a365d);
    color: #ffffff;
}

/* Tarjeta: Ver más opciones */
.card-more-options {
    background-color: #f8fafc;
    border: 1px dashed #cbd5e0;
}

.card-more-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    padding: 16px 12px;
}

.card-more-content h4 {
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.card-more-content p {
    font-size: 0.78rem;
    color: #718096;
    margin-bottom: 14px;
    line-height: 1.3;
}

.more-options-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.btn-booking, .btn-airbnb {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.btn-booking {
    background-color: #003580;
    color: #ffffff;
}

.btn-booking:hover {
    background-color: #00224f;
    color: #ffffff;
}

.btn-airbnb {
    background-color: #FF385C;
    color: #ffffff;
}

.btn-airbnb:hover {
    background-color: #e00b41;
    color: #ffffff;
}

/* =========================================================
   BOARDING PASS - PLANTILLA Y POSICIONAMIENTO DE TEXTO
   ========================================================= */
.boarding-pass-wrapper {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto 24px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    background-color: #fff;
}

.ticket-template {
    width: 100%;
    height: auto;
    display: block;
}

.ticket-field {
    position: absolute;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    font-family: 'Mendoline', cursive;
    font-weight: 700;
    color: #163852;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}

.field-pasajero {
    top: 28.2%;
    left: 12.8%;
    width: 38%;
    height: 7.5%;
    padding-left: 0;
    justify-content: flex-start;
    font-size: clamp(0.60rem, 1.2vw, 0.80rem);
}

.field-acompanantes {
    top: 44.8%;
    left: 12.8%;
    width: 23%;
    height: 7.5%;
    padding-left: 0;
    justify-content: flex-start;
    font-size: clamp(0.60rem, 1.2vw, 0.80rem);
}

.field-pnr-box {
    top: 44.2%;
    left: 41.9%;
    width: 18%;
    height: 7.5%;
    padding-left: 2px;
    justify-content: flex-start;
    font-size: clamp(0.50rem, 1.2vw, 0.81rem);
    transform: scale(1.12);
    transform-origin: left center; 
}

.field-pnr-stub {
    top: 67%;
    left: 78.2%;
    width: 20%;
    height: 8%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    color: #c5a059;
    font-size: clamp(0.60rem, 1.35vw, 0.88rem);
    letter-spacing: 1.5px;
    transform: scaleY(1.4);
    transform-origin: center;    
}

.field-fecha {
    top: 60.9%;
    left: 12.8%;
    width: max-content;
    height: 7.5%;
    justify-content: flex-start;
    font-size: clamp(0.60rem, 1.2vw, 0.70rem);
}

.field-hora {
    top: 60.9%;
    left: 41.5%;
    width: 15%;
    height: 7.5%;
    justify-content: flex-start;
    font-size: clamp(0.60rem, 1.2vw, 0.80rem);
}

.field-puerta {
    top: 60.9%;
    left: 59.2%;
    width: 25%;
    height: 7.5%;
    justify-content: flex-start;
    font-size: clamp(0.60rem, 1.2vw, 0.80rem);
}

.field-destino {
    top: 28.2%;
    left: 56.5%;
    width: 20%;
    height: 7.5%;
    justify-content: flex-start;
    font-size: clamp(0.60rem, 1.2vw, 0.80rem);
}

/* =========================================================
   CUENTA ATRÁS - PLANTILLA IMAGEN (ticket.webp)
   ========================================================= */
.countdown-ticket-wrapper {
    position: relative;
    width: 100%;
    max-width: 264px; /* Reducido un 40% */
    margin: 24px auto 0 auto;
}

.countdown-ticket-bg {
    width: 100%;
    height: auto;
    display: block;
}

/* Capa superpuesta sobre la imagen */
.countdown-ticket-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12% 8% 6% 8%;
    box-sizing: border-box;
}

.countdown-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
}

.countdown-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Líneas separadoras verticales (borrar si ya vienen dibujadas en ticket.webp) */
.countdown-col:not(:last-child) {
    border-right: 1px solid rgba(26, 54, 93, 0.3);
}

/* Números ajustados al tamaño reducido */
.countdown-num {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(1.5rem, 5.5vw, 2.2rem);
    color: #1a365d;
    line-height: 1;

    /* PARÁMETROS PARA ESTIRAR A LO ALTO */
    display: inline-block;
    transform: scaleY(1.45); /* Ajusta este número (ej. 1.2, 1.35, 1.5) hasta que quede a tu gusto */
    transform-origin: center;
}
.countdown-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: clamp(0.55rem, 1.8vw, 0.7rem);
    color: #1a365d;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 7px;
}