/* ============================================================
   JSC Automations — Lead Form Styles
   Paleta: Azul oscuro profesional
   ============================================================ */

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

:root {
  --bg:          #0F172A;
  --card:        #1E293B;
  --card2:       #263348;
  --accent:      #3B82F6;
  --accent-hover:#2563EB;
  --text:        #F1F5F9;
  --text-muted:  #94A3B8;
  --border:      #334155;
  --input-bg:    #0F172A;
  --error:       #EF4444;
  --success:     #22C55E;
  --radius:      10px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  padding: 40px 16px 60px;
}

/* ── Header ────────────────────────────────────────────────── */
.brand {
  text-align: center;
  margin-bottom: 36px;
}
.brand__name {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.brand__name span { color: var(--accent); }
.brand__slogan {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: 16px;
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 44px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.card__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.card__subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ── Progress bar ──────────────────────────────────────────── */
.progress {
  background: var(--border);
  border-radius: 99px;
  height: 4px;
  margin-bottom: 32px;
  overflow: hidden;
}
.progress__fill {
  background: var(--accent);
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
  width: 0%;
}

/* ── Form steps ────────────────────────────────────────────── */
.step { display: none; }
.step.active { display: block; }

.step__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.step__number {
  background: var(--accent);
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.step__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

/* ── Fields ────────────────────────────────────────────────── */
.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field label .req { color: var(--accent); margin-left: 2px; }

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-muted); opacity: 0.6; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.field input.error,
.field select.error,
.field textarea.error { border-color: var(--error); }

.field textarea { resize: vertical; min-height: 100px; }

/* Select arrow */
.select-wrap { position: relative; }
.select-wrap::after {
  content: "▾";
  position: absolute;
  right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 14px;
}
.select-wrap select { padding-right: 36px; cursor: pointer; }

/* ── Radio & Checkbox groups ───────────────────────────────── */
.options-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
.options-grid.cols-2 { grid-template-columns: 1fr 1fr; }

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}
.option-item:hover { border-color: var(--accent); }
.option-item input[type="radio"],
.option-item input[type="checkbox"] {
  width: 17px; height: 17px;
  min-width: 17px;
  accent-color: var(--accent);
  margin-top: 2px;
  cursor: pointer;
}
.option-item span {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}
.option-item:has(input:checked) {
  border-color: var(--accent);
  background: rgba(59,130,246,0.08);
}

/* ── Error messages ─────────────────────────────────────────── */
.field-error {
  color: var(--error);
  font-size: 12px;
  margin-top: 5px;
  display: none;
}
.field-error.show { display: block; }

/* ── Navigation buttons ─────────────────────────────────────── */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  gap: 12px;
}
.nav--end { justify-content: flex-end; }

.btn {
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--text); }

/* ── Habeas Data ─────────────────────────────────────────────── */
.habeas {
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.habeas input[type="checkbox"] {
  width: 18px; height: 18px; min-width: 18px;
  accent-color: var(--accent);
  margin-top: 2px;
  cursor: pointer;
}
.habeas p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.habeas strong { color: var(--text); }
.habeas:has(input:checked) { border-color: var(--accent); }

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn--loading .spinner { display: block; }
.btn--loading .btn-text { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Step indicators ─────────────────────────────────────────── */
.steps-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}
.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.3s, transform 0.3s;
}
.step-dot.active { background: var(--accent); transform: scale(1.3); }
.step-dot.done { background: var(--success); }

/* ── Success screen ──────────────────────────────────────────── */
#successScreen {
  display: none;
  text-align: center;
  padding: 20px 0;
}
.success-icon {
  width: 72px; height: 72px;
  background: rgba(34,197,94,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
}
#successScreen h2 {
  font-size: 24px; font-weight: 700;
  margin-bottom: 12px;
}
#successScreen p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 420px;
  margin: 0 auto 28px;
  line-height: 1.7;
}
.success-detail {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  text-align: left;
}
.success-detail span { color: var(--text); font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .card { padding: 28px 20px; }
  .options-grid.cols-2 { grid-template-columns: 1fr; }
  .card__title { font-size: 19px; }
}
