:root {
  --primary: #1A3A6B;
  --primary-light: #2E5FAD;
  --accent: #3CB371;
  --bg: #F4F7FC;
  --card: #FFFFFF;
  --border: #DDE3EE;
  --text: #1C2B4A;
  --text-muted: #6B7A9B;
  --error: #C62828;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(26, 58, 107, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Jost", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
}

/* ─── NAV ─────────────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo { color: #fff; font-size: 18px; font-weight: 600; text-decoration: none; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: #fff; }

/* ─── HERO ────────────────────────────────────────────────────────────────── */
#hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 80px 24px;
  text-align: center;
}
.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 4px 16px;
  font-size: 13px;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}
#hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.2;
  max-width: 680px;
  margin: 0 auto 16px;
}
#hero p {
  font-size: 18px;
  color: rgba(255,255,255,0.85);
  max-width: 520px;
  margin: 0 auto 32px;
}
.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 36px;
}
.hero-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255,255,255,0.9);
}
.hero-trust-item svg { flex-shrink: 0; }

/* ─── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.1s;
  text-decoration: none;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-white { background: #fff; color: var(--primary); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn-block { width: 100%; }

/* ─── WIZARD SECTION ──────────────────────────────────────────────────────── */
#wizard-section {
  max-width: 760px;
  margin: 48px auto;
  padding: 0 16px;
}

.wizard-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ─── PROGRESS ────────────────────────────────────────────────────────────── */
#wizard-progress {
  display: flex;
  align-items: center;
  padding: 24px 32px 0;
  gap: 0;
}
.progress-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  transition: background 0.3s, color 0.3s;
}
.progress-dot.active { background: var(--primary); color: #fff; }
.progress-dot.done { background: var(--accent); color: #fff; }
.progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  padding: 6px 32px 0;
  margin-bottom: 8px;
}
.progress-labels span {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  flex: 1;
}

/* ─── STEPS ───────────────────────────────────────────────────────────────── */
.wizard-step { display: none; padding: 32px; }
.wizard-step.active { display: block; }

.step-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}
.step-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.step-error {
  display: none;
  color: var(--error);
  font-size: 14px;
  background: #ffebee;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.step-note {
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
}

/* ─── FORMS ───────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .field-full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.field input,
.field select {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  font-family: "Jost", sans-serif;
  transition: border-color 0.2s;
  width: 100%;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary-light);
}
#cp-info {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  min-height: 18px;
}

/* ─── STEP ACTIONS ────────────────────────────────────────────────────────── */
.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  gap: 12px;
}
.step-actions .btn:first-child:last-child { margin-left: auto; }

/* ─── DEPENDIENTES ────────────────────────────────────────────────────────── */
.dep-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.dep-empty { color: var(--text-muted); font-size: 14px; padding: 12px 0; }
.dep-card {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}
.dep-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--primary);
}
.btn-remove {
  background: none;
  border: none;
  color: var(--error);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}
.btn-remove:hover { text-decoration: underline; }

/* ─── CUESTIONARIO ────────────────────────────────────────────────────────── */
.pregunta-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.pregunta-item:last-child { border-bottom: none; }
.pregunta-text { font-size: 15px; margin-bottom: 10px; }
.pregunta-options { display: flex; gap: 24px; }
.radio-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  cursor: pointer;
}
.radio-opt input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }
.loading-text { color: var(--text-muted); font-size: 14px; padding: 12px 0; }

/* ─── PLANES ──────────────────────────────────────────────────────────────── */
#planes-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.plan-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.plan-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.plan-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.plan-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.plan-coberturas {
  list-style: none;
  font-size: 13px;
  flex: 1;
  margin-bottom: 16px;
}
.plan-coberturas li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--bg);
}
.plan-sa { font-weight: 600; white-space: nowrap; color: var(--accent); }
.btn-plan {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  font-family: "Jost", sans-serif;
}
.btn-plan:hover { background: var(--primary-light); }

/* ─── RESULTADO ───────────────────────────────────────────────────────────── */
.result-hero {
  text-align: center;
  padding: 16px 0 28px;
}
.result-tag {
  display: inline-block;
  background: #e8f5e9;
  color: var(--accent);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.result-plan-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.result-num {
  font-size: 13px;
  color: var(--text-muted);
}
.result-prima {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 24px 0;
}
.prima-card {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px 24px;
  text-align: center;
}
.prima-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.prima-value { font-size: 26px; font-weight: 700; color: var(--primary); }
.prima-note { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.result-coberturas-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
}
#result-coberturas {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
#result-coberturas li {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
#result-coberturas li:last-child { border-bottom: none; }
#result-coberturas li:nth-child(even) { background: var(--bg); }
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ─── LEAD / GRACIAS ──────────────────────────────────────────────────────── */
.lead-summary {
  background: var(--bg);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.lead-summary span { color: var(--text-muted); }
.lead-summary strong { color: var(--primary); }

#lead-gracias { display: none; text-align: center; padding: 24px 0; }
.gracias-icon {
  width: 64px;
  height: 64px;
  background: #e8f5e9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
}
#lead-gracias h3 { font-size: 22px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
#lead-gracias p { color: var(--text-muted); font-size: 15px; }
.gracias-num {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 15px;
  margin: 16px auto;
  display: inline-block;
}
.gracias-num strong { color: var(--primary); font-size: 18px; }

/* ─── DOCUMENTOS ──────────────────────────────────────────────────────────── */
.docs-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1.5px solid var(--border);
}
.docs-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
}
.docs-group { margin-bottom: 20px; }
.docs-group:last-child { margin-bottom: 0; }
.docs-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.ine-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.toggle-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}
.toggle-opt input[type="radio"] { display: none; }
.toggle-opt--active {
  border-color: var(--primary);
  background: #EEF3FB;
  color: var(--primary);
  font-weight: 500;
}

.file-slot {
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
  background: #fff;
}
.file-slot:hover { border-color: var(--primary-light); }
.file-slot.has-file {
  border-style: solid;
  border-color: var(--accent);
}
.file-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.file-icon {
  width: 36px;
  height: 36px;
  background: var(--bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.file-slot.has-file .file-icon { background: #e8f5e9; }
.file-slot.has-file .file-icon svg { stroke: var(--accent); }
.file-text {
  flex: 1;
  min-width: 0;
}
.file-name {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-slot.has-file .file-name {
  color: var(--text);
  font-weight: 500;
}
.file-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.file-choose {
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: "Jost", sans-serif;
  pointer-events: none;
}
.file-slot.has-file .file-choose {
  background: var(--accent);
}

/* ─── LOADING OVERLAY ─────────────────────────────────────────────────────── */
#loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 58, 107, 0.5);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #fff;
  font-size: 18px;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── FOOTER ──────────────────────────────────────────────────────────────── */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 24px;
  font-size: 13px;
  margin-top: 48px;
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  #wizard-section { padding: 0 8px; }
  .wizard-step { padding: 20px 16px; }
  #wizard-progress { padding: 16px 16px 0; }
  .progress-labels { padding: 6px 16px 0; }
  .result-prima { flex-direction: column; }
  .result-actions { flex-direction: column; }
  #planes-list { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
