/* ── KADLAM BRAND COLORS ───────────────────────────────── */
:root {
  --purple:      #7E779F;
  --purple-dark: #5f5880;
  --purple-lt:   #F0EFFE;
  --blue:        #40779E;
  --teal:        #81B79F;
  --orange:      #FD813B;
  --red:         #BF3F3E;
  --dark-bg:     #1A1A2E;
  --white:       #FFFFFF;
  --gray-d:      #374151;
  --gray-m:      #6B7280;
  --gray-lt:     #F9FAFB;
  --gray-bd:     #E5E7EB;
  --green:       #16A34A;
}

/* ── RESET & BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               Helvetica, Arial, sans-serif;
  background: var(--dark-bg);
  color: var(--gray-d);
  min-height: 100vh;
}

/* ── HEADER ────────────────────────────────────────────── */
.header {
  background: var(--dark-bg);
  padding: 20px 40px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(126,119,159,0.2);
}

.logo {
  height: 36px;
  width: auto;
}

.logo-text {
  color: var(--purple);
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 2px;
}

/* ── LANDING PAGE ──────────────────────────────────────── */
.hero {
  background: var(--dark-bg);
  padding: 80px 24px 60px;
  text-align: center;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero h1 span { color: var(--purple); }

.hero .subheadline {
  color: #a8a8c8;
  font-size: clamp(16px, 2.5vw, 20px);
  line-height: 1.6;
  max-width: 620px;
  margin: 0 auto 48px;
}

/* ── VALUE PROPS ───────────────────────────────────────── */
.value-props {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
  margin: 0 auto 48px;
  text-align: left;
}

.value-prop {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(126,119,159,0.08);
  border: 1px solid rgba(126,119,159,0.2);
  border-radius: 10px;
  padding: 14px 18px;
}

.value-prop .check {
  color: var(--teal);
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.value-prop p {
  color: #c8c8e8;
  font-size: 15px;
  line-height: 1.5;
}

/* ── SOCIAL PROOF ──────────────────────────────────────── */
.social-proof {
  background: rgba(64,119,158,0.1);
  border: 1px solid rgba(64,119,158,0.25);
  border-radius: 10px;
  padding: 16px 24px;
  max-width: 540px;
  margin: 0 auto 40px;
  color: #a8c0d8;
  font-size: 14px;
  font-style: italic;
  line-height: 1.6;
}

/* ── PRICE BLOCK ───────────────────────────────────────── */
.price-block {
  margin-bottom: 32px;
}

.price {
  color: var(--white);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 6px;
}

.price-note {
  color: var(--gray-m);
  font-size: 14px;
}

/* ── CTA BUTTON ────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--purple);
  color: var(--white);
  font-size: 18px;
  font-weight: 600;
  padding: 16px 40px;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
}

.btn-primary:hover {
  background: var(--purple-dark);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

/* ── FOOTER ────────────────────────────────────────────── */
footer {
  background: var(--dark-bg);
  border-top: 1px solid rgba(126,119,159,0.15);
  padding: 24px;
  text-align: center;
  color: var(--gray-m);
  font-size: 13px;
  line-height: 1.6;
}

/* ── FORM PAGE ─────────────────────────────────────────── */
.form-page {
  background: #f4f4f8;
  min-height: calc(100vh - 77px);
  padding: 40px 16px 60px;
}

.form-container {
  max-width: 680px;
  margin: 0 auto;
}

/* Progress bar */
.progress-wrap {
  margin-bottom: 28px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label .step-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--purple);
}

.progress-label .time-text {
  font-size: 13px;
  color: var(--gray-m);
}

.progress-bar {
  height: 6px;
  background: var(--gray-bd);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--purple);
  border-radius: 99px;
  transition: width 0.35s ease;
}

/* Block card */
.block-card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 32px;
  display: none;
}

.block-card.active { display: block; }

.block-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark-bg);
  margin-bottom: 6px;
}

.block-subtitle {
  font-size: 14px;
  color: var(--gray-m);
  margin-bottom: 28px;
}

/* Question group */
.question-group {
  margin-bottom: 24px;
}

.question-group label.q-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-d);
  margin-bottom: 8px;
}

/* Text / number inputs */
.q-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-bd);
  border-radius: 8px;
  font-size: 15px;
  color: var(--gray-d);
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
}

.q-input:focus { border-color: var(--purple); }

/* Select dropdown */
.q-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-bd);
  border-radius: 8px;
  font-size: 15px;
  color: var(--gray-d);
  background: var(--white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.q-select:focus { border-color: var(--purple); }

/* Radio options */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-bd);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 14px;
  color: var(--gray-d);
}

.radio-option:hover {
  border-color: var(--purple);
  background: var(--purple-lt);
}

.radio-option input[type="radio"] {
  accent-color: var(--purple);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.radio-option input[type="radio"]:checked + span {
  font-weight: 600;
  color: var(--purple-dark);
}

.radio-option:has(input:checked) {
  border-color: var(--purple);
  background: var(--purple-lt);
}

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

.btn-back {
  background: none;
  border: 1.5px solid var(--gray-bd);
  color: var(--gray-m);
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-back:hover { border-color: var(--purple); color: var(--purple); }

.btn-next {
  background: var(--purple);
  color: var(--white);
  border: none;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-next:hover { background: var(--purple-dark); }

.btn-submit {
  background: var(--green);
  color: var(--white);
  border: none;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-submit:hover { background: #15803d; }

/* Loading overlay */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,26,46,0.85);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.loading-overlay.active { display: flex; }

.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(126,119,159,0.3);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.loading-text {
  color: var(--white);
  font-size: 18px;
  font-weight: 600;
}

.loading-sub {
  color: #a8a8c8;
  font-size: 14px;
  text-align: center;
  max-width: 340px;
}

/* ── SUCCESS PAGE ──────────────────────────────────────── */
.success-page {
  background: #f4f4f8;
  min-height: calc(100vh - 77px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.success-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  padding: 48px 40px;
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.checkmark {
  width: 72px;
  height: 72px;
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--green);
  margin: 0 auto 24px;
}

.success-card h1 {
  color: var(--dark-bg);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.success-card p {
  color: var(--gray-m);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.success-card p strong { color: var(--gray-d); }

.success-card .note {
  font-size: 13px;
  color: #9ca3af;
}

/* ── CANCEL / ERROR PAGES ──────────────────────────────── */
.cancel-page {
  background: var(--dark-bg);
  min-height: calc(100vh - 77px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  text-align: center;
}

.cancel-card {
  max-width: 460px;
}

.cancel-card h1 {
  color: var(--white);
  font-size: 24px;
  margin-bottom: 16px;
}

.cancel-card p {
  color: #a8a8c8;
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 28px;
}

.error-page {
  background: #f4f4f8;
  min-height: calc(100vh - 77px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.error-card {
  background: var(--white);
  border-radius: 14px;
  padding: 40px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.error-card h1 { color: #b91c1c; margin-bottom: 16px; }
.error-card p { color: var(--gray-m); margin-bottom: 12px; line-height: 1.6; }
.error-detail {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px;
  font-family: monospace;
  font-size: 12px;
  color: #991b1b;
  margin-bottom: 24px;
  text-align: left;
  word-break: break-all;
}

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 600px) {
  .header { padding: 16px 20px; }
  .hero { padding: 48px 20px 40px; }
  .block-card { padding: 24px 20px; }
  .success-card { padding: 32px 24px; }
  .form-nav { flex-wrap: wrap; }
}
