/* ============================================================
   ClariXERP — Hoja de estilos global
   Cubre: index, consulta-comprobantes, registro, consultas-masivas
   ============================================================ */

/* ── VARIABLES ── */
:root {
  --primary:       #3f51b5;
  --primary-dark:  #283593;
  --primary-light: #5c6bc0;
  --accent:        #7c4dff;
  --accent2:       #00bcd4;
  --bg:            #0a0c18;
  --bg2:           #0f1224;
  --surface:       #151930;
  --surface2:      #1c2040;
  --border:        rgba(92,107,192,0.2);
  --text:          #e8eaf6;
  --text-muted:    #9fa8da;
  --text-dim:      #4a5490;
  --green:         #00e676;
  --amber:         #ffab40;
  --red:           #ff5252;
  --radius:        14px;
  --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── BODY ── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grid de fondo */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(63,81,181,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63,81,181,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none; z-index: 0;
}

/* ── KEYFRAMES ── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes blink   { 0%,100%{opacity:1} 50%{opacity:.3} }
@keyframes grow    { from{width:0} to{width:var(--w)} }
@keyframes fadeIn  { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

/* ================================================================
   NAVEGACIÓN
   ================================================================ */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,12,24,.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 5%; height: 64px; gap: 1rem;
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.2rem;
  text-decoration: none; color: var(--text);
  letter-spacing: .03em; flex-shrink: 0;
}

.brand-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 900; color: #fff;
  letter-spacing: -.02em;
}

/* Links del nav (index) */
.nav-links {
  display: flex; align-items: center; gap: 2rem;
}
.nav-links a {
  color: var(--text-muted); text-decoration: none;
  font-size: .9rem; transition: color .2s;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff !important;
  padding: .45rem 1.2rem;
  border-radius: 8px;
  font-weight: 600 !important;
  font-size: .88rem !important;
  transition: opacity .2s, transform .2s !important;
}
.nav-cta:hover { opacity: .9; transform: translateY(-1px); }

/* Toggle móvil (index) */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text-muted); border-radius: 2px; transition: all .25s;
}

/* Nav derecha (masivas) */
.nav-right { display: flex; align-items: center; gap: 1.25rem; }

.nav-user {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; color: var(--text-muted);
}
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.nav-link {
  color: var(--text-muted); text-decoration: none;
  font-size: .85rem; transition: color .2s;
}
.nav-link:hover { color: var(--text); }

/* Volver atrás (consulta / registro) */
.nav-back {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted); text-decoration: none;
  font-size: .88rem; transition: color .2s;
}
.nav-back:hover { color: var(--text); }

/* Logout */
.btn-logout {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-muted); font-family: var(--font);
  font-size: .8rem; padding: .35rem .85rem;
  cursor: pointer; transition: all .2s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ================================================================
   BOTONES
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: .75rem 1.75rem; border-radius: var(--radius);
  font-family: var(--font); font-weight: 700; font-size: .95rem;
  cursor: pointer; border: none; text-decoration: none;
  transition: all .22s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 28px rgba(63,81,181,.35);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(63,81,181,.5); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-outline {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--text); transform: translateY(-1px); }

.btn-green {
  background: rgba(0,230,118,.12);
  border: 1px solid rgba(0,230,118,.25);
  color: var(--green);
}
.btn-green:hover { background: rgba(0,230,118,.2); }

.btn-sm {
  padding: .35rem .8rem; font-size: .78rem; border-radius: 7px;
  border: 1px solid var(--border); background: none;
  color: var(--text-muted); cursor: pointer; font-family: var(--font);
  transition: all .2s;
}
.btn-sm:hover { border-color: var(--primary-light); color: var(--text); }

/* Botón auth (registro) */
.btn-auth {
  width: 100%; padding: .85rem;
  border: none; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-family: var(--font);
  font-size: .97rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(63,81,181,.35);
  transition: all .22s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-auth:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(63,81,181,.5); }
.btn-auth:disabled { opacity: .6; cursor: not-allowed; }

/* Buscar (consulta comprobantes) */
.btn-buscar {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: .85rem 1.75rem; border-radius: var(--radius);
  font-weight: 700; font-size: 1rem;
  cursor: pointer; border: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 28px rgba(63,81,181,.35);
  transition: all .22s;
}
.btn-buscar:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(63,81,181,.5); }
.btn-buscar:disabled { opacity: .6; cursor: not-allowed; }

/* ── SPINNERS ── */
.spinner {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  animation: spin .7s linear infinite; display: none;
}
.spinner-sm {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  animation: spin .7s linear infinite; display: none;
}

/* ================================================================
   FORMULARIOS
   ================================================================ */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: flex; align-items: center; gap: 7px;
  font-size: .78rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: .4rem;
  text-transform: uppercase; letter-spacing: .04em;
}
.form-group label .lbl-icon { font-size: 14px; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 10px;
  padding: .72rem 1rem; color: var(--text);
  font-family: var(--font); font-size: .93rem; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(92,107,192,.15);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); }
.form-group select option  { background: var(--surface2); }
.form-group textarea { resize: vertical; min-height: 110px; }

.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }

.field-hint {
  font-size: .74rem; color: var(--text-dim);
  margin-top: .3rem; padding-left: .2rem;
}

/* Input con botón ojo */
.input-wrap { position: relative; }
.input-wrap input { padding-right: 2.8rem; }
.toggle-pass {
  position: absolute; right: .85rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  font-size: 1rem; padding: 0; line-height: 1;
  transition: color .2s;
}
.toggle-pass:hover { color: var(--text-muted); }

/* Fortaleza contraseña */
.pass-strength { display: flex; gap: 4px; margin-top: .5rem; }
.strength-bar {
  height: 4px; flex: 1; border-radius: 2px;
  background: var(--surface2); transition: background .3s;
}
.strength-label { font-size: .72rem; color: var(--text-dim); margin-top: .3rem; }

/* Checkbox términos */
.checkbox-group {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: .82rem; color: var(--text-muted);
  margin-bottom: 1.25rem; line-height: 1.5;
}
.checkbox-group input[type=checkbox] {
  width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--primary); cursor: pointer; margin-top: 2px;
}
.checkbox-group a { color: var(--primary-light); text-decoration: none; }
.checkbox-group a:hover { text-decoration: underline; }

/* Textarea monoespaciada (masivas) */
.textarea-wrap textarea {
  width: 100%; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 10px;
  padding: .9rem 1rem; color: var(--text);
  font-family: 'Courier New', monospace; font-size: .83rem;
  line-height: 1.7; resize: vertical; min-height: 180px;
  outline: none; transition: border-color .2s;
}
.textarea-wrap textarea:focus { border-color: var(--primary-light); }
.textarea-wrap textarea::placeholder { color: var(--text-dim); }
.textarea-hint { font-size: .75rem; color: var(--text-dim); margin-top: .45rem; }

/* ================================================================
   CARDS / SUPERFICIES
   ================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.card + .card { margin-top: 1.25rem; }
.card-title {
  font-size: .95rem; font-weight: 700;
  margin-bottom: 1rem; display: flex; align-items: center; gap: 8px;
}

/* Card consulta comprobantes */
.query-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.25rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

/* Card auth (registro) */
.auth-card {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2.5rem;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}

/* ================================================================
   ALERTAS
   ================================================================ */
.alert {
  border-radius: 10px; padding: .85rem 1rem;
  font-size: .85rem; margin-bottom: 1.1rem;
  display: none; align-items: center; gap: 8px;
  animation: fadeIn .3s ease;
}
.alert.show { display: flex; }
.alert-error  { background: rgba(255,82,82,.08); border: 1px solid rgba(255,82,82,.25); color: #ff8a80; }
.alert-success{ background: rgba(0,230,118,.08); border: 1px solid rgba(0,230,118,.25); color: var(--green); }

/* Info box */
.info-box {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(63,81,181,.08);
  border: 1px solid rgba(63,81,181,.2);
  border-radius: 10px; padding: .9rem 1rem;
  font-size: .82rem; color: var(--text-muted);
  margin-top: 1.5rem; line-height: 1.55;
}
.info-box-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ================================================================
   BADGES / PILLS / STATUS
   ================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 20px; padding: 4px 12px;
  font-size: .74rem; font-weight: 700; margin-top: 1rem;
}
.badge-ok  { background: rgba(0,230,118,.12); border: 1px solid rgba(0,230,118,.25); color: var(--green); }
.badge-err { background: rgba(255,82,82,.1);  border: 1px solid rgba(255,82,82,.25);  color: var(--red); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 5px currentColor; }

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 20px; padding: 3px 9px;
  font-size: .72rem; font-weight: 700;
}
.status-ok  { background: rgba(0,230,118,.12); border: 1px solid rgba(0,230,118,.25); color: var(--green); }
.status-err { background: rgba(255,82,82,.1);  border: 1px solid rgba(255,82,82,.25);  color: var(--red); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Result pills (masivas) */
.rpill { font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.rpill-ok  { background: rgba(0,230,118,.12); border: 1px solid rgba(0,230,118,.25); color: var(--green); }
.rpill-err { background: rgba(255,82,82,.1);  border: 1px solid rgba(255,82,82,.25);  color: var(--red); }
.rpill-tot { background: rgba(63,81,181,.12); border: 1px solid rgba(63,81,181,.25); color: var(--primary-light); }

/* ================================================================
   PROGRESS BAR
   ================================================================ */
.progress-wrap { margin-top: 1.25rem; display: none; }
.progress-bar-wrap { margin-top: 1rem; }

.progress-header {
  display: flex; justify-content: space-between;
  font-size: .82rem; color: var(--text-muted); margin-bottom: .4rem;
}
.progress-label {
  display: flex; justify-content: space-between;
  font-size: .75rem; color: var(--text-dim); margin-bottom: .3rem;
}
.progress-track {
  height: 6px; background: var(--surface2);
  border-radius: 3px; overflow: hidden;
}
.progress-track-lg {
  height: 8px; background: var(--surface2);
  border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px; transition: width .3s ease;
  animation: grow 2s ease-out forwards;
}

/* ================================================================
   TABLA DE RESULTADOS (masivas)
   ================================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .83rem; min-width: 700px; }

thead th {
  padding: .65rem 1rem; text-align: left;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-dim);
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
thead th:first-child { border-radius: 8px 0 0 0; }
thead th:last-child  { border-radius: 0 8px 0 0; }

tbody tr { border-bottom: 1px solid rgba(255,255,255,.04); transition: background .15s; }
tbody tr:hover { background: rgba(63,81,181,.05); }
tbody td { padding: .65rem 1rem; color: var(--text-muted); vertical-align: middle; }
tbody td:first-child { color: var(--text); font-weight: 600; }

/* ================================================================
   PAGE FOOTER (páginas internas)
   ================================================================ */
.page-footer {
  position: relative; z-index: 1;
  text-align: center; padding: 1.25rem 5%;
  font-size: .78rem; color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.page-footer a { color: var(--primary-light); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }

/* ================================================================
   WHATSAPP FLOTANTE
   ================================================================ */
.whatsapp-btn {
  position: fixed; bottom: 1.75rem; right: 1.75rem; z-index: 999;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25d366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.5);
  text-decoration: none; font-size: 28px;
  transition: transform .2s, box-shadow .2s;
}
.whatsapp-btn:hover { transform: translateY(-3px) scale(1.08); box-shadow: 0 8px 28px rgba(37,211,102,.65); }

/* ================================================================
   SCROLL REVEAL (index)
   ================================================================ */
.reveal { opacity:0; transform:translateY(24px); transition: opacity .55s, transform .55s; }
.reveal.visible { opacity:1; transform:none; }

/* ================================================================
   SECCIÓN GENÉRICA (index)
   ================================================================ */
section { position: relative; z-index: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 5rem 5%; }

.sec-tag {
  display: inline-block;
  font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary-light);
  margin-bottom: .75rem;
}
.sec-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800; line-height: 1.2; margin-bottom: .8rem;
}
.sec-sub {
  font-size: 1rem; color: var(--text-muted);
  max-width: 560px; line-height: 1.7; margin-bottom: 3rem;
}

/* ================================================================
   HERO (index)
   ================================================================ */
.hero {
  position: relative; z-index: 1;
  padding: 8rem 5% 6rem;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: center;
  max-width: 1200px; margin: 0 auto;
}
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(124,77,255,.12);
  border: 1px solid rgba(124,77,255,.28);
  color: #b39ddb;
  border-radius: 20px; padding: 5px 14px;
  font-size: .78rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 6px var(--green);
  animation: blink 2s infinite;
}
.hero h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 900; line-height: 1.12; margin-bottom: 1.4rem;
}
.hero h1 .gradient {
  background: linear-gradient(120deg, #e8eaf6, var(--primary-light) 50%, var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p {
  font-size: 1.05rem; color: var(--text-muted);
  line-height: 1.75; margin-bottom: 2.5rem; max-width: 480px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Hero card */
.hero-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}
.hero-card-header {
  background: var(--surface2); padding: .75rem 1.25rem;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.dot-row { display: flex; gap: 6px; }
.dot-row span { width: 11px; height: 11px; border-radius: 50%; }
.d-red   { background: #ff5f57; }
.d-amber { background: #ffbd2e; }
.d-green { background: #28c840; }
.hero-card-title { margin: 0 auto; font-size: .8rem; color: var(--text-dim); font-weight: 600; letter-spacing: .04em; }
.hero-card-body { padding: 1.5rem; }

/* Invoice preview */
.invoice-preview {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.2rem; font-size: .82rem; color: var(--text-muted);
}
.inv-row {
  display: flex; justify-content: space-between;
  padding: .3rem 0; border-bottom: 1px solid rgba(255,255,255,.05);
}
.inv-row:last-child { border-bottom: none; }
.inv-label { color: var(--text-dim); }
.inv-val   { color: var(--text); font-weight: 600; }
.inv-total { color: var(--accent2); font-size: 1rem; font-weight: 800; }
.inv-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0,230,118,.12); border: 1px solid rgba(0,230,118,.25);
  color: var(--green); border-radius: 20px; padding: 3px 10px;
  font-size: .72rem; font-weight: 700; margin-top: 1rem;
}
.sunat-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 1rem; padding: .7rem .9rem;
  background: rgba(63,81,181,.1); border: 1px solid rgba(63,81,181,.25);
  border-radius: 8px; font-size: .78rem;
}
.sunat-icon { font-size: 16px; }

/* ================================================================
   STATS (index)
   ================================================================ */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem; margin-top: 3rem;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem 1.5rem; text-align: center;
}
.stat-value {
  font-size: 2.6rem; font-weight: 900;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label {
  font-size: .8rem; color: var(--text-muted); margin-top: .3rem;
  text-transform: uppercase; letter-spacing: .06em;
}

/* ================================================================
   SERVICIOS (index)
   ================================================================ */
.services-bg { background: var(--bg2); }
.services-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem;
}
.srv-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  transition: border-color .25s, transform .25s, box-shadow .25s; cursor: default;
}
.srv-card:hover { border-color: var(--primary-light); transform: translateY(-4px); box-shadow: 0 12px 40px rgba(63,81,181,.2); }
.srv-icon {
  width: 52px; height: 52px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 1.25rem;
}
.srv-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; }
.srv-card p  { font-size: .88rem; color: var(--text-muted); line-height: 1.65; }
.srv-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.srv-tag { font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; letter-spacing: .03em; }

/* ================================================================
   CÓMO FUNCIONA (index)
   ================================================================ */
.steps-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem; counter-reset: steps;
}
.step-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  position: relative; counter-increment: steps;
}
.step-card::before {
  content: counter(steps, decimal-leading-zero);
  position: absolute; top: 1.25rem; right: 1.25rem;
  font-size: 2rem; font-weight: 900; color: var(--border); line-height: 1;
}
.step-icon { font-size: 2rem; margin-bottom: 1rem; display: block; }
.step-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.step-card p  { font-size: .86rem; color: var(--text-muted); line-height: 1.65; }

/* ================================================================
   PLANES (index)
   ================================================================ */
.plans-bg { background: var(--bg2); }
.plans-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem;
}
.plan-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  display: flex; flex-direction: column;
  transition: transform .25s, border-color .25s;
}
.plan-card:hover { transform: translateY(-4px); }
.plan-card.featured {
  border-color: var(--primary-light);
  background: linear-gradient(160deg, var(--surface2), var(--surface));
  position: relative; overflow: hidden;
}
.plan-card.featured::before {
  content: 'Más popular';
  position: absolute; top: 1rem; right: -1.4rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: .7rem; font-weight: 700;
  padding: 4px 2.2rem; transform: rotate(35deg); letter-spacing: .06em;
}
.plan-name { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.plan-price { font-size: 2.4rem; font-weight: 900; margin: .75rem 0 .25rem; color: var(--text); }
.plan-price sub { font-size: .9rem; font-weight: 500; color: var(--text-muted); vertical-align: bottom; line-height: 3; }
.plan-desc { font-size: .85rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.55; }
.plan-features { list-style: none; flex: 1; margin-bottom: 1.75rem; }
.plan-features li {
  display: flex; gap: 9px; align-items: flex-start;
  padding: .45rem 0; font-size: .87rem; color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.plan-features li:last-child { border-bottom: none; }
.plan-features li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; }
.plan-features li.off { opacity: .4; }
.plan-features li.off::before { content: '×'; color: var(--text-dim); }

/* ================================================================
   TESTIMONIOS (index)
   ================================================================ */
.testimonials-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem;
}
.testi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem;
}
.testi-stars { color: var(--amber); font-size: 1rem; margin-bottom: .75rem; }
.testi-text { font-size: .9rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 1.25rem; font-style: italic; }
.testi-author { display: flex; align-items: center; gap: .75rem; }
.testi-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem; color: #fff; flex-shrink: 0;
}
.testi-name { font-weight: 700; font-size: .88rem; }
.testi-role { font-size: .76rem; color: var(--text-dim); }

/* ================================================================
   CTA BANNER (index)
   ================================================================ */
.cta-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1a1040 50%, var(--primary-dark) 100%);
  border: 1px solid rgba(92,107,192,.3);
  border-radius: 20px; padding: 4rem 3rem;
  text-align: center; margin: 0 5%;
}
.cta-banner h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; margin-bottom: .8rem; }
.cta-banner p  { color: var(--text-muted); margin-bottom: 2rem; font-size: 1rem; }

/* ================================================================
   CONTACTO (index)
   ================================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.contact-item { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.contact-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(63,81,181,.15); border: 1px solid rgba(63,81,181,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.contact-item h4 { font-size: .9rem; font-weight: 700; margin-bottom: .2rem; }
.contact-item p  { font-size: .85rem; color: var(--text-muted); }

/* ================================================================
   FOOTER (index)
   ================================================================ */
footer {
  position: relative; z-index: 1;
  background: var(--bg2); border-top: 1px solid var(--border);
}
.footer-main {
  max-width: 1200px; margin: 0 auto;
  padding: 4rem 5% 2rem;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem;
}
.footer-brand p { font-size: .85rem; color: var(--text-muted); line-height: 1.65; margin-top: .75rem; }
.footer-col h4 { font-size: .85rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: .04em; }
.footer-col a {
  display: block; color: var(--text-muted); text-decoration: none;
  font-size: .84rem; margin-bottom: .55rem; transition: color .2s;
}
.footer-col a:hover { color: var(--primary-light); }
.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  padding: 1.25rem 5%;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; color: var(--text-dim); flex-wrap: wrap; gap: .75rem;
}
.social-links { display: flex; gap: .75rem; }
.social-link {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; text-decoration: none; transition: border-color .2s, transform .2s;
}
.social-link:hover { border-color: var(--primary-light); transform: translateY(-2px); }

/* ================================================================
   CONSULTA COMPROBANTES — layout y componentes específicos
   ================================================================ */
main {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 2rem 5% 3rem;
}
.page-layout {
  display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; align-items: start;
}
.page-header { padding-top: .5rem; }

.page-tag {
  font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary-light);
  margin-bottom: .4rem; display: block;
}
.page-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900; line-height: 1.2;
}
.page-title span {
  background: linear-gradient(120deg, #e8eaf6, var(--primary-light) 50%, var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.page-sub { font-size: .95rem; color: var(--text-muted); line-height: 1.7; }

.divider { border: none; border-top: 1px solid var(--border); margin: 1.75rem 0; }

/* Result cards */
.result-card {
  border-radius: var(--radius); padding: 1.5rem;
  border: 1px solid; animation: fadeIn .35s ease;
}
.result-card.valid  { background: rgba(0,230,118,.06); border-color: rgba(0,230,118,.25); }
.result-card.invalid{ background: rgba(255,82,82,.06);  border-color: rgba(255,82,82,.25); }
.result-header { display: flex; align-items: center; gap: 10px; margin-bottom: 1.1rem; }
.result-icon { font-size: 1.5rem; }
.result-title { font-weight: 800; font-size: 1rem; }
.result-title.ok  { color: var(--green); }
.result-title.err { color: var(--red); }
.result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .4rem 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: .88rem;
}
.result-row:last-child { border-bottom: none; }
.result-key   { color: var(--text-dim); }
.result-value { color: var(--text); font-weight: 600; }
.result-value.total { color: var(--accent2); font-size: 1rem; font-weight: 800; }

/* ================================================================
   REGISTRO — auth layout
   ================================================================ */
.center-wrap {
  position: relative; z-index: 1;
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 5%;
}
.auth-logo-wrap { text-align: center; margin-bottom: 1.75rem; }
.auth-logo-wrap .brand-logo { width: 52px; height: 52px; font-size: 22px; margin: 0 auto .75rem; }
.auth-logo-wrap h1 { font-size: 1.4rem; font-weight: 800; }
.auth-logo-wrap p  { font-size: .85rem; color: var(--text-muted); margin-top: .3rem; }

.tabs {
  display: flex; background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
  margin-bottom: 1.75rem; gap: 4px;
}
.tab-btn {
  flex: 1; padding: .55rem;
  border: none; background: transparent;
  color: var(--text-muted); font-family: var(--font);
  font-size: .88rem; font-weight: 600;
  border-radius: 7px; cursor: pointer; transition: all .2s;
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; box-shadow: 0 2px 12px rgba(63,81,181,.35);
}
.form-panel { display: none; }
.form-panel.active { display: block; }

.divider-text {
  text-align: center; margin: 1.25rem 0;
  font-size: .78rem; color: var(--text-dim); position: relative;
}
.divider-text::before, .divider-text::after {
  content: ''; position: absolute; top: 50%;
  width: calc(50% - 28px); height: 1px; background: var(--border);
}
.divider-text::before { left: 0; }
.divider-text::after  { right: 0; }

.forgot-link {
  display: block; text-align: right;
  font-size: .78rem; color: var(--primary-light);
  text-decoration: none; margin-bottom: 1.25rem;
}
.forgot-link:hover { text-decoration: underline; }

/* Selección de plan (registro) */
.plan-select-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.1rem; }
.plan-opt {
  border: 1px solid var(--border); border-radius: 10px;
  padding: .85rem; cursor: pointer; transition: all .2s; background: var(--bg2);
}
.plan-opt:hover { border-color: var(--primary-light); }
.plan-opt.selected { border-color: var(--primary-light); background: rgba(63,81,181,.1); }
.plan-opt input[type=radio] { display: none; }
.plan-opt-name  { font-weight: 700; font-size: .9rem; margin-bottom: .2rem; }
.plan-opt-desc  { font-size: .74rem; color: var(--text-dim); line-height: 1.4; }
.plan-opt-price { font-size: .8rem; color: var(--primary-light); font-weight: 700; margin-top: .3rem; }

/* ================================================================
   CONSULTAS MASIVAS — dashboard
   ================================================================ */
.page-wrap {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto;
  padding: 2rem 5% 4rem;
}
.page-hdr {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.stat-pills { display: flex; gap: .75rem; flex-wrap: wrap; }
.stat-pill {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: .6rem 1rem;
  font-size: .82rem; display: flex; align-items: center; gap: 7px;
}
.stat-pill strong { color: var(--primary-light); }

.mode-tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.mode-tab {
  padding: .5rem 1.1rem; border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  font-family: var(--font); font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.mode-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent; color: #fff;
}

.upload-zone {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 2.5rem; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.drag {
  border-color: var(--primary-light); background: rgba(63,81,181,.05);
}
.upload-zone input { display: none; }
.upload-icon { font-size: 2.5rem; margin-bottom: .75rem; display: block; }
.upload-zone h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.upload-zone p  { font-size: .83rem; color: var(--text-muted); line-height: 1.55; }
.upload-zone .link { color: var(--primary-light); text-decoration: underline; cursor: pointer; }

.template-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.25rem;
  font-size: .82rem; color: var(--text-muted); margin-top: 1rem;
}
.template-box code {
  display: block; margin-top: .5rem;
  color: var(--accent2); font-family: 'Courier New', monospace;
  font-size: .8rem; line-height: 1.7;
}

.action-row {
  display: flex; gap: .85rem; align-items: center;
  margin-top: 1.25rem; flex-wrap: wrap;
}
.row-count { font-size: .82rem; color: var(--text-muted); }

.results-hdr {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; flex-wrap: wrap; gap: .75rem;
}
.results-title { font-size: 1rem; font-weight: 700; }
.results-pills { display: flex; gap: .5rem; flex-wrap: wrap; }

.history-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 0; border-bottom: 1px solid rgba(255,255,255,.05);
  gap: 1rem; flex-wrap: wrap;
}
.history-row:last-child { border-bottom: none; }
.history-info { display: flex; align-items: center; gap: .75rem; }
.history-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: rgba(63,81,181,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.history-name { font-weight: 600; font-size: .88rem; }
.history-meta { font-size: .76rem; color: var(--text-dim); margin-top: 2px; }
.history-actions { display: flex; gap: .5rem; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 3rem; padding-top: 5rem; }
  .hero p { max-width: 100%; }
  .hero-card { max-width: 460px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .page-layout { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 720px) {
  .page-hdr { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 620px) {
  .nav-links {
    display: none; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg2); border-bottom: 1px solid var(--border);
    padding: 1.5rem 5%; gap: 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .form-row2 { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr; }
  .cta-banner { padding: 2.5rem 1.5rem; margin: 0 4%; }
  .plan-select-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .query-card { padding: 1.5rem; }
  .auth-card  { padding: 1.75rem; }
}
