/* satwebservice - estilos compartidos */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary:        #6366f1;
    --primary-dark:   #4f46e5;
    --primary-light:  #a5b4fc;
    --bg-dark:        #0f172a;
    --bg-card:        #1e293b;
    --bg-input:       #334155;
    --bg-input-focus: rgba(51, 65, 85, .85);
    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --border:         #334155;
    --border-soft:    rgba(99, 102, 241, .2);
    --accent-cyan:    #22d3ee;
    --accent-emerald: #34d399;
    --accent-red:     #f87171;
    --accent-yellow:  #fbbf24;
    --shadow-card:    0 25px 60px rgba(0, 0, 0, .4);
    --shadow-button:  0 8px 24px rgba(99, 102, 241, .4);
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body { overflow-x: hidden; }

/* Background animado con orbs */
.bg-orbs {
    position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
}
.bg-orbs span {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: .15;
    animation: float 20s ease-in-out infinite;
}
.bg-orbs span:nth-child(1) { width: 600px; height: 600px; background: var(--primary); top: -200px; left: -100px; }
.bg-orbs span:nth-child(2) { width: 400px; height: 400px; background: var(--accent-cyan); bottom: -100px; right: -100px; animation-delay: -7s; }
.bg-orbs span:nth-child(3) { width: 300px; height: 300px; background: var(--accent-emerald); top: 50%; left: 50%; animation-delay: -14s; }
@keyframes float {
    0%, 100% { transform: translate(0,0) scale(1); }
    25% { transform: translate(50px,-50px) scale(1.1); }
    50% { transform: translate(-30px,30px) scale(.9); }
    75% { transform: translate(30px,50px) scale(1.05); }
}

/* Cards */
.card {
    background: rgba(30, 41, 59, .85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-card);
    position: relative; z-index: 1;
}

/* Logo */
.logo {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px; color: #fff;
    box-shadow: 0 8px 24px rgba(99, 102, 241, .3);
}

/* Headings */
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
h1 .gradient { background: linear-gradient(135deg, var(--primary-light), var(--accent-cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 13px; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 1px; margin-bottom: 12px; }
.subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }

/* Form */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px; font-weight: 500;
    margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: .5px;
}
.input-wrapper { position: relative; }
.input-wrapper i {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--text-secondary); font-size: 16px;
    transition: color .25s; pointer-events: none;
}
.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    width: 100%;
    padding: 14px 16px 14px 46px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit; font-size: 15px;
    transition: all .25s; outline: none;
}
.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus {
    border-color: var(--primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .15);
}
.input-wrapper input:focus ~ i { color: var(--primary-light); }
.input-wrapper input::placeholder { color: var(--text-muted); }

/* File inputs */
.file-input {
    position: relative; padding: 14px; background: var(--bg-input);
    border: 2px dashed var(--border); border-radius: 12px;
    cursor: pointer; transition: all .25s; text-align: center;
    color: var(--text-secondary);
}
.file-input:hover { border-color: var(--primary); color: var(--text-primary); }
.file-input.has-file { border-color: var(--accent-emerald); color: var(--accent-emerald); border-style: solid; }
.file-input input[type=file] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.file-input .filename { font-size: 13px; font-weight: 500; }
.file-input .hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border: none; border-radius: 12px;
    font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all .25s; text-decoration: none;
    width: 100%;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-button); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary { background: rgba(51, 65, 85, .85); }
.btn.danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.btn.ghost { background: transparent; border: 1px solid var(--border); }

/* Alerts */
.alert {
    padding: 12px 16px; border-radius: 12px; margin-bottom: 16px;
    font-size: 13px; display: flex; align-items: flex-start; gap: 10px;
    line-height: 1.5;
}
.alert i { flex-shrink: 0; margin-top: 1px; }
.alert.ok    { background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .25); color: #4ade80; }
.alert.err   { background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .25); color: #fca5a5; }
.alert.warn  { background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .25); color: #fbbf24; }
.alert.info  { background: rgba(99, 102, 241, .1); border: 1px solid rgba(99, 102, 241, .25); color: var(--primary-light); }

/* Loaders */
.preloader {
    position: fixed; inset: 0; background: rgba(15, 23, 42, .85);
    backdrop-filter: blur(8px); z-index: 9999;
    display: none; align-items: center; justify-content: center;
}
.preloader.show { display: flex; }
.spinner {
    width: 56px; height: 56px;
    border: 4px solid rgba(99, 102, 241, .2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toasts */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; pointer-events: none; }
.toast {
    background: var(--bg-card); border: 1px solid var(--border-soft);
    color: var(--text-primary); padding: 14px 18px; border-radius: 12px;
    margin-bottom: 10px; max-width: 360px; pointer-events: auto;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
    display: flex; align-items: flex-start; gap: 10px; font-size: 13px;
    animation: slideIn .3s ease;
}
.toast.ok { border-color: rgba(34, 197, 94, .4); }
.toast.err { border-color: rgba(239, 68, 68, .4); }
.toast.warn { border-color: rgba(251, 191, 36, .4); }
.toast i { flex-shrink: 0; margin-top: 2px; }
.toast.ok i { color: #4ade80; }
.toast.err i { color: #fca5a5; }
.toast.warn i { color: #fbbf24; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Disclaimer / consent box */
.consent-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    max-height: 280px;
    overflow-y: auto;
    font-size: 13px; line-height: 1.6; color: var(--text-secondary);
    white-space: pre-wrap;
    margin-bottom: 16px;
}
.consent-box::-webkit-scrollbar { width: 8px; }
.consent-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.checkbox-row {
    display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px;
    cursor: pointer; user-select: none;
}
.checkbox-row input[type=checkbox] {
    width: 18px; height: 18px; margin-top: 2px;
    accent-color: var(--primary); cursor: pointer; flex-shrink: 0;
}
.checkbox-row label { font-size: 13px; line-height: 1.5; cursor: pointer; }

/* Util */
.text-center { text-align: center; }
.muted { color: var(--text-secondary); }
.hidden { display: none !important; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex-row { display: flex; gap: 12px; }
.flex-row > * { flex: 1; }

/* Layouts */
.auth-layout {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.auth-card { width: 100%; max-width: 460px; }
.auth-card.wide { max-width: 640px; }
.auth-header { text-align: center; margin-bottom: 28px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.hidden { display: none; }
.modal-overlay { position: absolute; inset: 0; background: rgba(15,23,42,.85); backdrop-filter: blur(8px); }
.modal-content { position: relative; z-index: 1; width: 100%; max-height: 92vh; overflow-y: auto; }

/* Estado pills (usado en solicitudes y otras vistas) */
.estado-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.estado-solicitada    { background: rgba(99,102,241,.15); color: var(--primary-light); }
.estado-en_proceso    { background: rgba(251,191,36,.15); color: #fbbf24; }
.estado-lista         { background: rgba(34,211,238,.15); color: var(--accent-cyan); }
.estado-descargando   { background: rgba(34,211,238,.15); color: var(--accent-cyan); }
.estado-completada    { background: rgba(52,211,153,.15); color: var(--accent-emerald); }
.estado-expirada      { background: rgba(148,163,184,.15); color: var(--text-secondary); }
.estado-rechazada     { background: rgba(239,68,68,.15); color: var(--accent-red); }
.estado-fallida       { background: rgba(239,68,68,.15); color: var(--accent-red); }
.estado-cuota_agotada { background: rgba(239,68,68,.15); color: var(--accent-red); }
.estado-duplicada     { background: rgba(251,191,36,.15); color: #fbbf24; }

/* Footer */
.footer {
    text-align: center; margin-top: 24px;
    color: var(--text-muted); font-size: 12px;
}
.footer a { color: var(--primary-light); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
