/* ============================================
   VALENCIA CF KIOSK - CSS UNIFICADO
   Optimizado para kiosk 9:16 y movil
   ============================================ */

/* RESET */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --vcf-orange: #E66728;
    --vcf-dark: #111111;
    --vcf-black: #1A1A1A;
    --vcf-white: #FFFFFF;
    --vcf-success: #059669;
    --vcf-error: #DC2626;
    --text-muted: rgba(255,255,255,0.6);
}

html {
    height: -webkit-fill-available;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--vcf-dark);
    color: var(--vcf-white);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ============================================
   SCREENS - Navegacion
   ============================================ */
.screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    position: relative;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* ============================================
   CONTENEDOR COMUN
   ============================================ */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px;
    position: relative;
}

/* ============================================
   LOGO ESCUDO (consistente en todas las pantallas)
   ============================================ */
.screen-logo {
    display: block;
    width: 72px;
    height: auto;
    margin: 0 auto 16px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* ============================================
   PANTALLA 1: BIENVENIDA (VIDEO)
   ============================================ */
#welcomeScreen {
    background: #000;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.welcome-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    pointer-events: none;
    z-index: 1;
}

@media (min-aspect-ratio: 9/16) {
    .welcome-video {
        width: auto;
        height: 100vh;
        max-width: calc(100vh * 9 / 16);
        left: 50%;
        transform: translateX(-50%);
    }
}

.welcome-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 48px 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    z-index: 2;
    text-align: center;
    pointer-events: none;
}

.welcome-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.welcome-tap {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    animation: pulseFade 2.5s ease-in-out infinite;
}

@keyframes pulseFade {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ============================================
   PANTALLA 2: IDIOMA
   ============================================ */
#languageScreen {
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.language-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.language-logo {
    width: 140px;
    height: auto;
    margin: 0 auto 32px;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.language-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.language-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.language-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
}

.language-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(255,255,255,0.04);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--vcf-white);
    min-height: 72px;
}

.language-btn:active {
    background: var(--vcf-orange);
    border-color: var(--vcf-orange);
    transform: scale(0.97);
}

.language-flag {
    width: 72px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.language-label {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Boton A de licencia - esquina inferior derecha fija */
.license-btn-fixed {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9990;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Georgia', serif;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
}
.license-btn-fixed:active {
    background: rgba(230,103,40,0.3);
    transform: scale(0.92);
}

/* Legacy boton info (ya no se usa, pero mantener por compatibilidad) */
.info-button {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px auto 0;
    cursor: pointer;
    color: var(--vcf-white);
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.25s ease;
}

.info-button:active {
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
}

/* ============================================
   PANTALLA 3: MEMBRESIA
   ============================================ */
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-align: center;
}

.membership-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.membership-card {
    background: rgba(255,255,255,0.04);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.membership-card:active {
    transform: scale(0.98);
}

.membership-card.selected {
    border-color: var(--vcf-orange);
    background: rgba(230,103,40,0.08);
}

.membership-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--vcf-orange);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.membership-header h3,
.membership-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.membership-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--vcf-orange);
    margin-bottom: 12px;
}

.membership-benefits {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.membership-benefits li {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    padding-left: 20px;
    position: relative;
}

.membership-benefits li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vcf-orange);
}

/* ============================================
   BOTON VOLVER
   ============================================ */
.btn-back {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    z-index: 50;
    transition: all 0.2s ease;
}

.btn-back:active {
    background: rgba(255,255,255,0.15);
    transform: scale(0.95);
}

/* ============================================
   PANTALLA 4: DISENO DE CARNET (CARRUSEL)
   ============================================ */
#designScreen > .container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: 16px;
    padding-bottom: 100px;
    overflow: hidden;
}

.design-carousel-container {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 8px auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.design-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0;
    scrollbar-width: none;
}

.design-carousel::-webkit-scrollbar { display: none; }

.design-card {
    min-width: 100%;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    padding: 8px;
}

.design-card.active {
    opacity: 1;
    transform: scale(1.02);
}

.design-image {
    width: 100%;
    max-width: 260px;
    height: auto;
    max-height: calc(100vh - 300px);
    max-height: calc(100dvh - 300px);
    aspect-ratio: 4/7;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(230,103,40,0.25);
    object-fit: contain;
    background: rgba(255,255,255,0.03);
    border: 2px solid rgba(230,103,40,0.15);
}

.design-card.active .design-image {
    border-color: rgba(230,103,40,0.7);
    box-shadow: 0 12px 40px rgba(230,103,40,0.4);
}

.design-name {
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
    color: var(--vcf-orange);
}

.carousel-btn {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    background: rgba(230,103,40,0.9);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.92);
}

.carousel-btn.prev { left: 4px; }
.carousel-btn.next { right: 4px; }

.carousel-btn span {
    font-size: 1.8rem;
    color: white;
    font-weight: bold;
    line-height: 1;
}

.design-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 10px 0;
    flex-shrink: 0;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    width: 24px;
    border-radius: 4px;
    background: var(--vcf-orange);
}

/* Boton continuar fijo en design screen */
#continueToForm {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    min-width: 200px;
    padding: 14px 40px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 12px;
    background: var(--vcf-orange);
    color: white;
    border: none;
    box-shadow: 0 6px 20px rgba(230,103,40,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* CRITICO: Ocultar cuando designScreen no es activa */
#designScreen:not(.active) #continueToForm {
    display: none !important;
}

#continueToForm:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

#continueToForm:not(:disabled):active {
    transform: translateX(-50%) scale(0.96);
}

/* ============================================
   PANTALLA 5: FORMULARIO
   ============================================ */
#formScreen {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.form-container {
    padding-top: 60px;
    padding-bottom: 40px;
}

.member-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: rgba(255,255,255,0.85);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: var(--vcf-white);
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--vcf-orange);
    background: rgba(255,255,255,0.07);
}

.form-input.error {
    border-color: var(--vcf-error);
}

.form-error {
    display: block;
    font-size: 0.8rem;
    color: var(--vcf-error);
    margin-top: 4px;
    min-height: 1em;
}

/* iOS zoom prevention */
input[type="text"],
input[type="email"],
input[type="tel"] {
    font-size: 16px !important;
}

input[name="dni"] {
    text-transform: uppercase;
}

/* ============================================
   TECLADO EN PANTALLA (ON-SCREEN KEYBOARD)
   ============================================ */
.osk-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border-top: 2px solid rgba(230,103,40,0.4);
    z-index: 9000;
    padding: 8px 4px 12px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: transform 0.25s ease;
}

.osk-overlay.active {
    transform: translateY(0);
}

.osk-keyboard {
    max-width: 480px;
    margin: 0 auto;
}

.osk-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
}

.osk-key {
    min-width: 30px;
    height: 42px;
    background: #444;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s ease;
    flex: 0 0 auto;
    padding: 0 6px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.osk-key:active {
    background: var(--vcf-orange);
    transform: scale(0.93);
}

.osk-key.wide {
    min-width: 52px;
    font-size: 0.8rem;
}

.osk-key.active-shift {
    background: var(--vcf-orange);
}

.osk-key.space {
    flex: 1;
    max-width: 200px;
}

.osk-key.done {
    background: var(--vcf-orange);
    min-width: 64px;
    font-weight: 700;
}

/* Input activo resaltado con el teclado abierto */
.osk-input.osk-active {
    border-color: var(--vcf-orange) !important;
    background: rgba(230,103,40,0.08) !important;
    box-shadow: 0 0 0 3px rgba(230,103,40,0.2);
}

/* Cuando el teclado esta visible, subir el formulario */
#formScreen.osk-visible {
    padding-bottom: 280px;
}

#formScreen.osk-visible .form-container {
    padding-bottom: 280px;
}

/* ============================================
   PANTALLA 6: PAGO (procesando)
   ============================================ */
.payment-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.payment-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(230,103,40,0.2);
    border-top-color: var(--vcf-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 24px;
}

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

.payment-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.payment-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================
   PANTALLA 7: PAGO EXITOSO
   ============================================ */
.confirmation-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 48px;
    padding-bottom: 40px;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(46,204,113,0.35);
}

.confirmation-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.confirmation-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.member-info {
    background: rgba(230,103,40,0.08);
    border: 2px solid rgba(230,103,40,0.25);
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 300px;
}

.member-info .member-number-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.member-info .member-number-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--vcf-orange);
    letter-spacing: 1px;
}

/* ============================================
   PANTALLA 8: SELFIE
   ============================================ */
#selfieScreen > .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 56px;
}

.camera-container {
    position: relative;
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1;
    margin: 16px 0;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}

#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.camera-guide {
    width: 65%;
    aspect-ratio: 1;
    border: 3px dashed rgba(230,103,40,0.7);
    border-radius: 50%;
    box-shadow: inset 0 0 0 4px rgba(0,0,0,0.2), 0 0 0 999px rgba(0,0,0,0.35);
}

.camera-instruction {
    position: absolute;
    bottom: 16px;
    color: white;
    font-size: 0.85rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.6);
    padding: 6px 14px;
    border-radius: 16px;
}

.photo-preview {
    width: 100%;
    max-width: 340px;
    margin: 16px 0;
}

.photo-preview img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}

.photo-actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.photo-actions button {
    flex: 1;
}

.camera-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 340px;
}

/* ============================================
   PANTALLA 9: CARNET FINAL
   ============================================ */
#confirmationScreen > .container {
    padding-top: 40px;
}

.carnet-final {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.carnet-card {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 36px rgba(230,103,40,0.3), 0 4px 14px rgba(0,0,0,0.3);
    border: 2px solid rgba(230,103,40,0.4);
}

.carnet-bg {
    width: 100%;
    display: block;
    min-height: 180px;
    background: var(--vcf-black);
}

/* Foto rectangular encajada en el espacio limpio del diseno V6 */
/* Zonas V6: photo=(264,522,240,320), name=(80,858), number=(120,906) */
/* Canvas 768x1376 → photo: top=38%, w=31.2%, aspect 3:4 */
/* Bajada para no pisar texto SOCIO/SOCIO ABONADO de ninguna tarjeta */
.carnet-photo-frame {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translateX(-50%);
    width: 31.2%;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 2px;
    background: transparent;
}

.carnet-photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
}

/* Nombre y numero superpuestos al carnet - posiciones V6 */
/* Name zone: (80,858,608,40) on 768x1376 → top=62.4%, w=79.2%, h=2.9% */
/* Number zone: (120,906,528,32) on 768x1376 → top=65.8%, w=68.8%, h=2.3% */
.carnet-name {
    position: absolute;
    top: 62.4%;
    left: 50%;
    transform: translateX(-50%);
    width: 79%;
    height: 2.9%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 4px rgba(0,0,0,0.95), 0 0 12px rgba(0,0,0,0.7);
    margin: 0;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carnet-number {
    position: absolute;
    top: 65.8%;
    left: 50%;
    transform: translateX(-50%);
    width: 69%;
    height: 2.3%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--vcf-orange);
    text-shadow: 0 1px 4px rgba(0,0,0,0.95), 0 0 12px rgba(0,0,0,0.7);
    margin: 0;
    letter-spacing: 0.5px;
}

/* ============================================
   BOTONES GLOBALES
   ============================================ */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--vcf-orange);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:active {
    transform: scale(0.97);
    background: #d45520;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: rgba(255,255,255,0.06);
    color: var(--vcf-white);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:active {
    background: rgba(255,255,255,0.12);
    transform: scale(0.97);
}

.btn-lg {
    padding: 18px 32px;
    font-size: 1.1rem;
}

.btn-download {
    margin-top: 8px;
}

.amunt {
    font-size: 1.2rem;
    text-align: center;
    margin-top: 16px;
    color: var(--vcf-orange);
}

/* ============================================
   LOADER GLOBAL
   ============================================ */
.loader {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(8px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(230,103,40,0.2);
    border-top-color: var(--vcf-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    margin-top: 16px;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
}

/* ============================================
   MENSAJES
   ============================================ */
.error-message,
.success-message {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 28px;
    border-radius: 10px;
    z-index: 99999;
    max-width: 90%;
    min-width: 260px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

.error-message {
    background: linear-gradient(135deg, var(--vcf-error), #991b1b);
    color: white;
}

.success-message {
    background: linear-gradient(135deg, var(--vcf-success), #047857);
    color: white;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 380px) {
    .screen-logo { width: 56px; }
    .language-logo { width: 110px; }
    .language-title { font-size: 1.5rem; }
    .section-title { font-size: 1.2rem; }
    .confirmation-title { font-size: 1.2rem; }
    .carnet-final { max-width: 260px; }
}

@media (min-height: 850px) {
    .language-logo { width: 160px; margin-bottom: 40px; }
    .language-subtitle { margin-bottom: 48px; }
    .design-carousel-container { max-width: 380px; }
    .design-image { max-width: 300px; }
}

/* ============================================
   KIOSK 1080x1920
   ============================================ */
@media (min-width: 1080px) and (min-height: 1920px) {
    .design-image { max-width: 420px !important; }
    .design-name { font-size: 1.6rem !important; }
    #continueToForm {
        padding: 18px 56px !important;
        font-size: 1.3rem !important;
        min-width: 360px !important;
        bottom: 36px !important;
    }
    .camera-container { max-width: 500px !important; }
}

/* ============================================
   BOTON MUTE/UNMUTE GLOBAL
   ============================================ */
.mute-btn {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.85);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.mute-btn:active {
    transform: scale(0.9);
    background: rgba(230,103,40,0.7);
}

.mute-btn.muted {
    border-color: rgba(230,103,40,0.5);
    color: var(--vcf-orange);
}

/* En design screen, subir el mute para no tapar CONTINUAR */
#designScreen.active ~ .mute-btn,
body:has(#designScreen.active) .mute-btn {
    bottom: 80px;
}

/* ============================================
   COPYRIGHT
   ============================================ */
.copyright-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.copyright-modal.active { display: flex; }

/* El contenido del modal se define en copyright.js con estilos inline */
.copyright-content {
    background: rgba(15,15,15,0.98);
    color: #ddd;
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 520px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.copyright-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* ============================================
   PWA INSTALL BANNER
   ============================================ */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a1a0a 100%);
    border-top: 2px solid var(--vcf-orange);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.6);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.pwa-install-banner.visible {
    transform: translateY(0);
}

.pwa-install-banner .pwa-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: contain;
    background: rgba(255,255,255,0.05);
    padding: 4px;
}

.pwa-install-banner .pwa-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-banner .pwa-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-install-banner .pwa-desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.3;
}

.pwa-install-banner .pwa-btn-install {
    background: var(--vcf-orange);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
    letter-spacing: 0.3px;
}

.pwa-install-banner .pwa-btn-install:active {
    background: #cf5a20;
    transform: scale(0.97);
}

.pwa-install-banner .pwa-btn-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.2s;
}

.pwa-install-banner .pwa-btn-close:hover {
    color: rgba(255,255,255,0.7);
}

/* iOS specific instructions overlay */
.pwa-ios-steps {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
    margin-top: 4px;
}

.pwa-ios-steps strong {
    color: var(--vcf-orange);
}

/* Cuando el banner está visible, subir el botón de licencia y mute */
.pwa-install-banner.visible ~ .license-btn-fixed,
body:has(.pwa-install-banner.visible) .license-btn-fixed {
    bottom: 100px;
}

.pwa-install-banner.visible ~ .mute-btn,
body:has(.pwa-install-banner.visible) .mute-btn {
    bottom: 100px;
}

@media (max-width: 400px) {
    .pwa-install-banner {
        padding: 12px 14px;
        gap: 10px;
    }
    .pwa-install-banner .pwa-icon {
        width: 40px;
        height: 40px;
    }
    .pwa-install-banner .pwa-title {
        font-size: 0.85rem;
    }
    .pwa-install-banner .pwa-btn-install {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}
