@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

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

:root {
  --ink: #1a1a1a;
  --ink-muted: #5a5f65;
  --ink-faint: #8f949a;
  --parchment: #f0f4f6;
  --warm-white: #ffffff;
  --gold: #4a7282;
  --gold-light: #a3c1ce;
  --gold-faint: #e8eff3;
  --border: #c5d6de;
  --tier-groundwork: #c4784a;
  --tier-growth: #c4a832;
  --tier-refine: #4a8c5c;
  --font: 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--warm-white);
  color: var(--ink);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ── Progress ── */
.progress-wrap[hidden] {
  display: none !important;
}

.progress-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

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

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

.progress-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ── Shell — vertically centered via flex spacers (stable when step height changes) ── */
.shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 120px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.shell::before,
.shell::after {
  content: '';
  flex: 1 1 0;
  min-height: 0;
}

body.has-progress .shell {
  padding-top: 88px;
}

.boot-msg {
  text-align: center;
  font-size: 18px;
  color: var(--ink-muted);
  font-weight: 400;
}

/* ── Step transitions (only between steps, not on chip toggle) ── */
.step.step-enter {
  animation: stepIn 0.42s var(--ease) forwards;
}

.step.step-out {
  animation: stepOut 0.28s var(--ease) forwards;
}

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

@keyframes stepOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.step-title {
  font-size: clamp(32px, 5.5vw, 44px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 20px;
}

.step-title em {
  font-style: italic;
  color: var(--gold);
}

.step-body {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: 580px;
  margin-bottom: 36px;
  white-space: pre-line;
}

.step-meta {
  font-size: 15px;
  color: var(--ink-faint);
  margin-bottom: 32px;
  letter-spacing: 0.02em;
}

.sec-tag {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.q-label {
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 22px;
  display: block;
}

.q-hint {
  font-size: 13px;
  font-weight: 300;
  color: var(--ink-faint);
  font-style: italic;
  margin: -12px 0 18px;
  line-height: 1.5;
}

.q-hint.likert-prompt {
  font-size: 18px;
  font-weight: 400;
  color: var(--ink-muted);
  font-style: normal;
  margin: 0 0 22px;
  line-height: 1.55;
  max-width: 640px;
}

.likert-statement {
  font-size: 26px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 32px;
  max-width: 640px;
}

/* ── Name (combined first + last) ── */
.name-fields {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 8px;
}

.name-field label {
  display: block;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.name-field label .req {
  color: var(--ink);
}

.field-input-line {
  border: none;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 10px 0;
  font-size: 20px;
  background: transparent;
}

.field-input-line:focus {
  border-bottom-color: var(--gold);
  box-shadow: none;
}

/* ── Phone ── */
.phone-field {
  margin-bottom: 8px;
}

.phone-sublabel {
  display: block;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.phone-input-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
}

.phone-country-select {
  flex: 0 0 auto;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  background: transparent;
  border: none;
  padding: 10px 4px 10px 0;
  cursor: pointer;
  outline: none;
}

.phone-national {
  flex: 1;
  min-width: 0;
  border-bottom: none !important;
  padding-bottom: 10px;
}

.phone-input-row:focus-within {
  border-bottom-color: var(--gold);
}

.choice-hint {
  margin: -8px 0 22px;
  font-style: normal;
  color: var(--ink-faint);
  font-size: 15px;
}

.chip-letter {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--warm-white);
}

.chip-btn.selected .chip-letter {
  border-color: var(--gold);
  color: var(--ink);
  background: var(--gold-faint);
}

.chip-text {
  flex: 1;
}

.other-field {
  margin-top: 16px;
  overflow: hidden;
  max-height: 80px;
  opacity: 1;
  transition: max-height 0.25s var(--ease), opacity 0.2s var(--ease), margin 0.25s var(--ease);
}

.other-field[hidden] {
  display: block;
  visibility: hidden;
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
}

/* ── Inputs ── */
.field-input {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 300;
  color: var(--ink);
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-faint);
}

.field-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.field-error {
  margin-top: 10px;
  font-size: 13px;
  color: #b54a4a;
}

/* ── Choice chips ── */
.chip-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chip-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  color: var(--ink-muted);
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.chip-btn:hover {
  border-color: var(--gold-light);
  color: var(--ink);
}

.chip-btn.selected {
  background: var(--gold-faint);
  border-color: var(--gold);
  color: var(--ink);
}

/* ── Likert scale ── */
.likert-scale {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.likert-btn {
  flex: 1 1 100px;
  min-width: 88px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  color: var(--ink-faint);
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 8px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.likert-btn:hover {
  border-color: var(--gold-light);
  color: var(--ink-muted);
}

.likert-btn.selected {
  background: var(--gold);
  border-color: var(--gold);
  color: white;
  transform: scale(1.03);
}

/* ── Nav ── */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.nav-row--back-only {
  justify-content: flex-start;
}

.btn-back {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 0;
  transition: color 0.2s;
}

.btn-back:hover { color: var(--ink-muted); }
.btn-back[hidden] { visibility: hidden; }

.btn-primary {
  font-family: var(--font);
  font-size: 17px;
  font-weight: 500;
  color: var(--warm-white);
  background: var(--ink);
  border: none;
  cursor: pointer;
  padding: 16px 32px;
  border-radius: 8px;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s;
}

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

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ── Result ── */
.result-card {
  text-align: left;
  animation: stepIn 0.55s var(--ease) forwards;
}

.result-score-line {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}

.result-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 20px;
}

.result-tier-badge.groundwork { color: var(--tier-groundwork); }
.result-tier-badge.growth_in_motion { color: var(--tier-growth); }
.result-tier-badge.refine_multiply { color: var(--tier-refine); }

.result-emoji { font-size: 1.1em; }

.result-body {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--ink-muted);
  margin-bottom: 32px;
  white-space: pre-line;
  max-width: 580px;
}

.result-note {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 20px;
  line-height: 1.6;
}

.result-note.ok { color: var(--gold); }
.result-note.warn { color: #a06820; }

.btn-book {
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
}

/* ── Calculating ── */
.calculating {
  text-align: center;
  padding: 60px 0;
}

.calculating-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.calculating-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 1s ease-in-out infinite;
}

.calculating-dots span:nth-child(2) { animation-delay: 0.15s; }
.calculating-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.calculating p {
  font-size: 15px;
  font-weight: 300;
  color: var(--ink-muted);
}

.hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

@media (max-width: 560px) {
  .shell { padding: 40px 18px 100px; }
  body.has-progress .shell { padding-top: 80px; }
  .likert-scale { flex-direction: column; }
  .likert-btn { flex: 1 1 auto; width: 100%; }
  .progress-wrap { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .step, .step-enter, .result-card, .progress-fill, .chip-btn, .likert-btn, .btn-primary, .other-field {
    animation: none !important;
    transition: none !important;
  }
}
