/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --indigo:       #4A4A88;
  --indigo-light: #EEEEF8;
  --indigo-mid:   #B8B8DC;
  --indigo-dark:  #22224A;
  --ink:          #1C1C2E;
  --mid:          #52526A;
  --muted:        #9898B0;
  --surface:      #F7F7FB;
  --white:        #FFFFFF;
  --rule:         rgba(0,0,0,0.07);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--surface);
  color: var(--ink);
  min-height: 100vh;
  padding: 0;
}

/* ── Site nav ──────────────────────────────────────────────────────────────── */
.site-nav {
  background: var(--white);
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
  padding: 0.75rem 1.5rem;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: space-between;
  justify-content: space-between;
}
.site-nav .brand-logo {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-nav .brand-logo img { width: 32px; height: 32px; border-radius: 8px; display: block; }
.site-nav .brand-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.site-nav .nav-link { font-size: 13px; color: var(--muted); text-decoration: none; font-weight: 500; }

/* ── App wrapper ───────────────────────────────────────────────────────────── */
.app {
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

/* ── Brand bar ─────────────────────────────────────────────────────────────── */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem 0.85rem;
}
.brand-logo { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--indigo);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.brand-tag  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.brand-tool {
  font-size: 11px; font-weight: 600; color: var(--indigo);
  background: var(--indigo-light); padding: 4px 12px;
  border-radius: 20px; border: 0.5px solid var(--indigo-mid);
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

/* ── Card header ───────────────────────────────────────────────────────────── */
.card-head {
  padding: 1.1rem 1.4rem 0.95rem;
  border-bottom: 0.5px solid var(--rule);
  display: flex; align-items: flex-start; justify-content: space-between;
}
.head-title { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.head-sub   { font-size: 12px; color: var(--muted); }
.head-sub strong { color: var(--indigo); font-weight: 600; }
.step-pill  {
  font-size: 11px; color: var(--muted);
  background: var(--surface); border: 0.5px solid var(--rule);
  border-radius: 20px; padding: 3px 11px;
  white-space: nowrap; margin-top: 2px;
}

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

/* ── Step 0: Setup ─────────────────────────────────────────────────────────── */
.step-inner { padding: 1.75rem 1.4rem 1.5rem; }

.setup-fields { display: flex; flex-direction: column; gap: 1.4rem; }

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

.setup-label {
  font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.4;
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
}
.optional {
  font-size: 11px; font-weight: 400; color: var(--muted);
  background: var(--surface); border: 0.5px solid var(--rule);
  border-radius: 20px; padding: 1px 8px;
}

.setup-num {
  width: 110px;
  font-size: 22px; font-weight: 600; color: var(--indigo);
  border: 0.5px solid var(--indigo-mid); border-radius: 10px;
  padding: 0.5rem 0.75rem; background: var(--indigo-light);
  outline: none; font-family: inherit;
  -moz-appearance: textfield;
}
.setup-num::-webkit-outer-spin-button,
.setup-num::-webkit-inner-spin-button { -webkit-appearance: none; }
.setup-num:focus { border-color: var(--indigo); }

.setup-note {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  margin-top: 2px;
}

.setup-text {
  width: 100%; font-size: 14px; color: var(--ink);
  border: 0.5px solid var(--indigo-mid); border-radius: 10px;
  padding: 0.7rem 1rem; background: var(--surface);
  outline: none; font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.setup-text:focus { border-color: var(--indigo); background: var(--white); }

/* ── Step 1: Arc ───────────────────────────────────────────────────────────── */
.arc-step {
  padding: 1.25rem 1.4rem 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
}

.arc-canvas {
  width: 100%;
  height: 230px;
  display: block;
  border-radius: 10px;
}

/* Slider */
.arc-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--indigo-mid);
  outline: none;
  cursor: pointer;
}
.arc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--indigo);
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(74,74,136,0.35);
  transition: transform 0.1s;
}
.arc-slider::-webkit-slider-thumb:active { transform: scale(1.15); }
.arc-slider::-moz-range-thumb {
  width: 24px; height: 24px;
  border-radius: 50%; border: none;
  background: var(--indigo);
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(74,74,136,0.35);
}

/* Age row */
.arc-age-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.arc-age-end {
  font-size: 11px; font-weight: 500;
  color: var(--muted); letter-spacing: 0.04em;
  text-transform: uppercase;
}
.arc-age-end.faded { opacity: 0.45; }
.arc-age-center {
  font-size: 16px; font-weight: 600; color: var(--indigo);
}

/* Reflection */
.arc-reflection {
  background: var(--indigo-light);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  font-size: 14px; color: var(--mid); line-height: 1.65;
  opacity: 0;
}
.arc-reflection strong { color: var(--indigo); font-weight: 600; }

/* ── Question steps ────────────────────────────────────────────────────────── */
.q-step-inner { padding: 1.5rem 1.4rem 1.4rem; }

.q-step-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 6px;
}
.q-step-q {
  font-size: 18px; font-weight: 600; color: var(--ink);
  line-height: 1.35; margin-bottom: 4px;
}
.q-step-subq {
  font-size: 15px; font-weight: 500; color: var(--mid);
  line-height: 1.45; margin-bottom: 8px;
}
.q-step-hint {
  font-size: 13px; color: var(--muted);
  line-height: 1.6; margin-bottom: 1.1rem;
}
.q-step-area {
  width: 100%; font-size: 14px; color: var(--ink);
  border: 0.5px solid var(--rule); border-radius: 10px;
  padding: 0.85rem 1rem; background: var(--surface);
  outline: none; resize: none; font-family: inherit;
  min-height: 120px; line-height: 1.6;
  transition: border-color 0.15s, background 0.15s;
}
.q-step-area:focus { border-color: var(--indigo); background: var(--white); }

/* ── Complete view ─────────────────────────────────────────────────────────── */
.complete-view { display: none; }
.complete-view.active { display: block; }

.complete-arc-wrap {
  padding: 1.1rem 1.4rem 0;
}
.arc-mini {
  width: 100%; height: 140px; display: block;
}

.complete-context {
  font-size: 12px; color: var(--muted);
  padding: 0.5rem 1.4rem 0;
  line-height: 1.5;
}
.complete-context strong { color: var(--indigo); font-weight: 600; }

.complete-answers {
  padding: 0.5rem 1.4rem 1rem;
}

.answer-block {
  padding: 1rem 0;
  border-top: 0.5px solid var(--rule);
}
.answer-block:first-child { border-top: none; margin-top: 0.5rem; }

.answer-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--indigo);
  margin-bottom: 6px;
}
.answer-text {
  font-size: 14px; color: var(--mid);
  line-height: 1.65; white-space: pre-wrap;
}

.complete-foot {
  padding: 0 1.4rem 1.4rem;
  display: flex; justify-content: center;
}
.start-again {
  font-size: 12px; color: var(--muted);
  background: none; border: none; cursor: pointer;
  font-family: inherit; text-decoration: underline;
  text-underline-offset: 3px;
}
.start-again:hover { color: var(--ink); }

/* ── Bottom nav ────────────────────────────────────────────────────────────── */
.bottom-nav {
  border-top: 0.5px solid var(--rule);
  padding: 0.8rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
}
.dots { display: flex; gap: 6px; align-items: center; }
.dot  { width: 22px; height: 3px; border-radius: 3px; background: var(--rule); transition: background 0.25s; }
.dot.done   { background: var(--indigo-mid); }
.dot.active { background: var(--indigo); }

.btns { display: flex; gap: 7px; }
.btn-back {
  font-size: 13px; color: var(--muted); background: none;
  border: 0.5px solid var(--rule); border-radius: 9px;
  padding: 6px 14px; cursor: pointer; font-family: inherit;
}
.btn-back:hover { background: var(--rule); }
.btn-next {
  font-size: 13px; font-weight: 600; color: var(--white);
  background: var(--indigo); border: none; border-radius: 9px;
  padding: 6px 18px; cursor: pointer; font-family: inherit;
  transition: opacity 0.15s;
}
.btn-next:hover { opacity: 0.85; }
.btn-pdf {
  font-size: 13px; font-weight: 600; color: var(--indigo);
  background: var(--indigo-light); border: 0.5px solid var(--indigo-mid);
  border-radius: 9px; padding: 6px 14px; cursor: pointer; font-family: inherit;
}
.btn-pdf:hover { background: var(--indigo-mid); }

/* ── Disclaimer ────────────────────────────────────────────────────────────── */
.disclaimer {
  padding: 0.85rem 0.25rem 0;
  font-size: 11px; color: var(--muted);
  line-height: 1.6; text-align: center;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 1rem 0.75rem 2rem; }
  .arc-canvas { height: 180px; }
  .arc-mini   { height: 110px; }
  .q-step-q   { font-size: 16px; }
  .q-step-subq { font-size: 14px; }
  .q-step-area { min-height: 100px; }
}
