@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');

/* --- BASES Y PALETA --- */
body { 
    font-family: 'Inter', sans-serif; 
    background-color: #f2f3fa; 
    margin: 0; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    min-height: 100dvh; 
    user-select: none; -webkit-user-select: none; touch-action: manipulation; 
    color: #333;
}

/* --- LÓGICA DE PANTALLAS (SPLASH/MENU) --- */
.screen { display: none; animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.active { display: block; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- CONTENEDOR --- */
.container { 
    background: #ffffff; width: 90%; max-width: 420px; padding: 30px; 
    border-radius: 16px; box-shadow: 0 10px 40px rgba(45, 71, 152, 0.10); 
    text-align: center; position: relative; overflow: hidden; 
    box-sizing: border-box; border: 1px solid #f0f0f0;
}

/* --- TIPOGRAFÍA --- */
h2 { color: #2d4798; margin-top: 0; font-weight: 700; }
.logo-area { margin-bottom: 40px; }
.logo-text { color: #2d4798; font-weight: 900; font-size: 26px; letter-spacing: -1px; margin: 0; }
.logo-sub { color: #c1c1c2; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; margin-bottom: 25px;}

/* --- FORMULARIOS --- */
select, input, textarea { 
    width: 100%; padding: 14px; margin-top: 6px; 
    border: 1px solid #c1c1c2; border-radius: 8px; box-sizing: border-box; 
    background: #fff; font-family: inherit; font-size: 16px; transition: border 0.2s;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: #2d4798; background-color: #fcfcfc; }

/* --- BOTONES --- */
.btn-main { 
    background: #2d4798; color: white; width: 100%; padding: 18px; 
    border: none; border-radius: 10px; font-size: 16px; font-weight: 600; 
    cursor: pointer; box-shadow: 0 4px 12px rgba(45, 71, 152, 0.25); 
    transition: transform 0.1s, background 0.2s; margin-top: 25px; 
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-main:active { transform: scale(0.97); background: #1f3370; }
.btn-secondary { background: #f2f3fa; color: #555; border: 2px solid #f2f3fa; box-shadow: none; margin-top: 10px;}
.btn-secondary:active { background: #f2f3fa; }

/* --- UTILIDADES Y FOOTER --- */
.hidden { display: none !important; }
.row { display: flex; gap: 10px; } .col { flex: 1; }
.footer-info { display: flex; justify-content: space-between; margin-top: 30px; padding-top: 15px; border-top: 1px solid #f2f3fa; font-size: 11px; color: #999; }
.help-btn { cursor: pointer; text-decoration: underline; color: #2d4798; }

/* --- PIN PAD Y KIOSCO --- */
.pin-display { background: #f2f3fa; border: 2px solid #c1c1c2; border-radius: 8px; padding: 15px; font-size: 24px; letter-spacing: 10px; margin-bottom: 20px; font-family: monospace; color: #333; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key { background: #f2f3fa; border: none; padding: 18px 0; border-radius: 8px; font-size: 20px; font-weight: 600; color: #495057; cursor: pointer; }
.key:active { background: #e1e4f0; }
.key-c { background: #ffdca6; color: #7a5214; }
.key-ok { background: #2d4798; color: white; }

/* --- ESTILOS ESPECÍFICOS AÑADIDOS --- */
.btn-back { position: absolute; top: 20px; left: 20px; background: none; border: none; color: #c1c1c2; font-size: 28px; cursor: pointer; padding: 0; line-height: 1; transition: color 0.2s; text-decoration: none; }
.btn-back:active { color: #2d4798; transform: scale(0.9); }
.error { color: #dc3545; font-size: 14px; margin-top: 15px; display: none; font-weight: bold; padding: 10px; background: #ffe6e6; border-radius: 6px; }
.success-box { text-align: center; padding: 20px; border-radius: 12px; margin-top: 20px; }
.success-box.in { background-color: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.success-box.out { background-color: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }

/* --- PWA Y LOADER --- */
.pwa-area { margin-top: 30px; border-top: 1px solid #f2f3fa; padding-top: 20px; }
.btn-install { display: none; background: #333; color: white; padding: 12px; font-size: 13px; border-radius: 8px; width: 100%; border: none; font-weight: 500; cursor: pointer; }
.ios-instruct { display: none; font-size: 12px; color: #888; background: #f2f3fa; padding: 10px; border-radius: 8px; }
.loader { border: 3px solid rgba(255,255,255,0.3); border-top: 3px solid #2d4798; border-radius: 50%; width: 20px; height: 20px; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }