/* ============================================================
   RECLAMAJUSTO v2 — ONE-PAGE SCROLL
   css/styles.css
   ============================================================ */

/* ── Variables ───────────────────────────────────────────────── */
:root {
  --blue:       #1a56db;
  --blue-dk:    #1e40af;
  --blue-glow:  rgba(26,86,219,.12);
  --blue-ring:  rgba(26,86,219,.2);
  --green:      #10b981;
  --amber:      #f59e0b;
  --red:        #ef4444;
  --bg:         #f8fafc;
  --surface:    #ffffff;
  --border:     #e2e8f0;
  --text:       #0f172a;
  --muted:      #64748b;
  --light:      #94a3b8;
  --radius:     14px;
  --radius-sm:  8px;
  --ease:       cubic-bezier(.4,0,.2,1);
  --font:       'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-logo {
  font-weight: 800;
  font-size: 17px;
  color: var(--blue);
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-logo span { color: var(--text); }

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-track {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
  border-radius: 99px;
  transition: width .5s var(--ease);
}

#progress-pct {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  min-width: 32px;
  text-align: right;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 60%, #1a56db 100%);
  color: #fff;
  padding: 56px 20px 48px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  margin-bottom: 20px;
  letter-spacing: .2px;
}

.hero h1 {
  font-size: clamp(26px, 6vw, 44px);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -.5px;
  margin-bottom: 16px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #93c5fd, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 16px;
  opacity: .82;
  max-width: 420px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

.trust-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  opacity: .85;
}

/* ── Form root / sections ──────────────────────────────────── */
.form-area {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* Las secciones están ocultas por defecto */
.form-section {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  transition: none;
}

/* Al añadir .revealed, anima la entrada */
.form-section.revealed {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  max-height: 9999px;
  overflow: visible;
  transition:
    opacity .4s var(--ease),
    transform .4s var(--ease);
}

/* La sección resultado no tiene max-height limit */
#s-resultado {
  max-height: none;
}

.sec-inner {
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--border);
}

.sec-inner:last-child { border-bottom: none; }

.sec-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--blue-glow);
  color: var(--blue);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}

.sec-q {
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
  letter-spacing: -.2px;
}

.sec-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ── Inputs ────────────────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-ring);
}
.form-input::placeholder { color: var(--light); }

/* Fecha nativa */
.date-native {
  cursor: pointer;
}

.date-fallback-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.form-input-inline {
  width: 140px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color .2s;
}
.form-input-inline:focus { border-color: var(--blue); }

.form-textarea {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  line-height: 1.7;
  transition: border-color .2s, box-shadow .2s;
}
.form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-ring);
}
.form-textarea::placeholder { color: var(--light); }

/* ── Choice pills ──────────────────────────────────────────── */
.pills-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: border-color .18s, background .18s, transform .15s;
  width: 100%;
}
.choice-pill:hover {
  border-color: var(--blue);
  background: var(--blue-glow);
  transform: translateX(3px);
}
.choice-pill.selected {
  border-color: var(--blue);
  background: var(--blue-glow);
  box-shadow: 0 0 0 3px var(--blue-ring);
}

.pill-emoji { font-size: 20px; flex-shrink: 0; }

/* Pills pequeñas (fila) */
.pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.choice-pill-sm {
  padding: 10px 18px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: border-color .18s, background .18s;
  white-space: nowrap;
}
.choice-pill-sm:hover,
.choice-pill-sm.selected {
  border-color: var(--blue);
  background: var(--blue-glow);
  color: var(--blue);
}

/* ── Grupo unificado ────────────────────────────────────────── */
.group-block {
  margin-bottom: 24px;
}

.group-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 10px;
}

.label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--light);
}

/* Grid de iconos grandes */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

@media (max-width: 400px) {
  .icon-grid { grid-template-columns: repeat(2, 1fr); }
}

.icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 10px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  transition: border-color .15s, background .15s, transform .15s;
  line-height: 1.3;
}

.icon-card > :first-child { font-size: 28px; }
.icon-card span { font-size: 12px; }

.icon-card:hover {
  border-color: var(--blue);
  background: var(--blue-glow);
  color: var(--text);
  transform: scale(1.03);
}

.icon-card.selected {
  border-color: var(--blue);
  background: var(--blue-glow);
  color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-ring);
}

/* ── Baja médica ────────────────────────────────────────────── */
.baja-dias {
  margin-top: 16px;
  animation: fadeIn .3s ease;
}
.baja-dias .form-input { max-width: 200px; }

/* ── Contacto ───────────────────────────────────────────────── */
.contact-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-wrap > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.label-opt {
  font-weight: 400;
  color: var(--light);
}

.tel-wrap {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.tel-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-ring);
}

.tel-prefix {
  background: #f1f5f9;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-right: 2px solid var(--border);
}

.tel-wrap .form-input {
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding-left: 12px;
}
.tel-wrap .form-input:focus { box-shadow: none; }

.field-hint {
  font-size: 12px;
  color: var(--light);
  margin-top: 2px;
}

.rgpd-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.6;
}
.rgpd-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--blue);
  cursor: pointer;
}
.lnk { color: var(--blue); text-decoration: underline; }

.form-nota {
  font-size: 12px;
  color: var(--light);
  text-align: center;
}

/* ── Botones ────────────────────────────────────────────────── */
.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--blue), #2563eb);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  box-shadow: 0 4px 16px rgba(26,86,219,.3);
}
.btn-next:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,86,219,.4);
}
.btn-next:disabled {
  opacity: .4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn-next.hidden { display: none !important; }

.btn-submit {
  width: 100%;
  padding: 17px 24px;
  background: linear-gradient(135deg, var(--blue), #2563eb);
  color: #fff;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(26,86,219,.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(26,86,219,.45);
}
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }

.skip-note {
  font-size: 12px;
  color: var(--light);
  margin-top: 8px;
}

/* ── Errores ────────────────────────────────────────────────── */
.field-error {
  font-size: 13px;
  color: var(--red);
  font-weight: 500;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.field-error.hidden { display: none; }

/* ── Carga / Loading ────────────────────────────────────────── */
#result-loading {
  text-align: center;
  padding: 40px 20px;
}

.ai-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.loading-h {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
  margin: 0 auto;
  text-align: left;
}

.ls {
  font-size: 14px;
  color: var(--light);
  padding: 8px 14px;
  border-radius: 8px;
  transition: all .3s;
}
.ls.active {
  background: var(--blue-glow);
  color: var(--blue);
  font-weight: 600;
}

/* ── Resultado ──────────────────────────────────────────────── */
.result-wrap { padding: 8px 0 20px; }

.result-top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.score-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--sc, var(--green));
  flex-shrink: 0;
  background: var(--surface);
}
.score-val {
  font-size: 24px;
  font-weight: 900;
  color: var(--sc, var(--green));
  line-height: 1;
}
.score-lbl {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.result-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.result-sub { font-size: 14px; }

.informe-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}
.informe-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
}
.informe-text em { font-style: italic; color: var(--muted); font-size: 13px; }

.range-disclaimer {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 13px;
  color: #854d0e;
  line-height: 1.6;
  margin-bottom: 20px;
}

.success-box {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 20px;
}
.success-icon { font-size: 40px; margin-bottom: 12px; }
.success-box h3 { font-size: 20px; font-weight: 800; color: #14532d; margin-bottom: 10px; }
.success-box p  { font-size: 15px; color: #166534; line-height: 1.7; }
.success-sub { font-size: 13px !important; color: var(--muted) !important; margin-top: 10px; }

.legal-disclaimer {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

/* ── Descalificado ──────────────────────────────────────────── */
.disqualified-screen {
  text-align: center;
  padding: 60px 20px;
  max-width: 500px;
  margin: 0 auto;
}
.dq-icon { font-size: 56px; margin-bottom: 16px; }
.disqualified-screen h2 { font-size: 24px; font-weight: 800; margin-bottom: 14px; }
.disqualified-screen p  { font-size: 15px; color: var(--muted); line-height: 1.8; margin-bottom: 28px; }

/* ── Utilidades ─────────────────────────────────────────────── */
.hidden { display: none !important; }

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

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 52px 20px 36px;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }

.footer-brand h3 { font-size: 18px; font-weight: 800; color: #f1f5f9; margin-bottom: 10px; }
.footer-brand p  { font-size: 13px; line-height: 1.8; }

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col a  { color: #94a3b8; text-decoration: none; font-size: 13px; transition: color .2s; }
.footer-col a:hover { color: #f1f5f9; }

.footer-divider { border: none; border-top: 1px solid #1e293b; margin-bottom: 24px; }

.footer-rgpd {
  font-size: 12px;
  line-height: 1.8;
  color: #64748b;
  margin-bottom: 20px;
}
.footer-rgpd strong { color: #94a3b8; }
.footer-rgpd a { color: #94a3b8; }

.footer-copy {
  font-size: 11px;
  color: #475569;
  line-height: 1.7;
}

/* ── Secciones de texto legal ───────────────────────────────── */
.legal-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 52px 20px;
}
.legal-section h2 { font-size: 24px; font-weight: 800; margin-bottom: 20px; }
.legal-section h3 { font-size: 16px; font-weight: 700; margin: 24px 0 8px; }
.legal-section p  { font-size: 14px; color: var(--muted); line-height: 1.8; margin-bottom: 12px; }
.legal-section ul { font-size: 14px; color: var(--muted); line-height: 2; padding-left: 20px; }

/* ── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 480px) {
  .hero h1 { font-size: 26px; }
  .result-top { flex-direction: column; align-items: flex-start; }
  .score-ring { width: 68px; height: 68px; }
  .score-val  { font-size: 20px; }
}

/* ── Dark mode (respeta preferencia del SO) ─────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0f172a;
    --surface:  #1e293b;
    --border:   #334155;
    --text:     #f1f5f9;
    --muted:    #94a3b8;
    --light:    #64748b;
    --blue-glow: rgba(26,86,219,.18);
    --blue-ring: rgba(26,86,219,.25);
  }
  .topbar  { background: rgba(15,23,42,.94); }
  .tel-prefix { background: #1e293b; border-color: #334155; }
  .range-disclaimer { background: #1c1917; border-color: #78350f; color: #fbbf24; }
  .success-box { background: linear-gradient(135deg, #052e16, #14532d); border-color: #166534; }
  .success-box h3 { color: #bbf7d0; }
  .success-box p  { color: #86efac; }
}
