/* The Absolute Freedom — diagnostic styling
   Brand palette: navy + cool blue, calm typography, adviser-tone.
   Iframe-friendly: light, neutral background, no edge bleed. */

:root {
  --dark: #123249;       /* brand navy */
  --darker: #0c1522;     /* brand deep navy */
  --accent: #457793;     /* brand mid blue */
  --soft: #dde8ed;       /* brand wash */
  --muted: #6B7785;
  --text: #123249;
  --bg: #FFFFFF;
  --bg-alt: #FFFFFF;
  --bg-soft: #F5F8FA;
  --border: #C8D6DD;
  --shadow: 0 8px 32px rgba(18, 50, 73, 0.08);
  --radius: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Calibri', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.frame {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand-bar {
  text-align: center;
  padding: 24px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.brand-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}

.brand-title {
  font-family: 'Georgia', 'Cambria', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
}

.stage {
  flex: 1;
}

.brand-foot {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  padding-top: 32px;
  margin-top: 32px;
  border-top: 1px solid var(--border);
}

/* ─── View blocks ─── */

.view {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 32px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  animation: fadeIn 0.4s ease-out;
}

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

.q-eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

/* ─── Opening hero ─── */

.view-hero {
  text-align: center;
  padding-top: 36px;
  padding-bottom: 32px;
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.20em;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 14px;
}

.hero-headline {
  font-size: 34px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 14px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 520px;
  margin: 0 auto 28px;
}

.view-hero .q-label {
  text-align: left;
}

.view-hero .btn-row {
  justify-content: flex-start;
}

.hero-privacy {
  font-size: 12px;
  color: var(--muted);
  margin: 24px 0 0;
  text-align: left;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .view-hero {
    padding-top: 20px;
    padding-bottom: 24px;
  }
  .hero-headline { font-size: 24px; }
  .hero-sub { font-size: 14px; margin-bottom: 22px; }
  .hero-privacy { font-size: 11px; }
}

.q-title {
  font-family: 'Georgia', 'Cambria', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 18px;
  line-height: 1.3;
}

.q-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--muted);
  margin-top: 16px;
  margin-bottom: 8px;
}

.q-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 24px;
  white-space: pre-line;
}

.q-context {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 18px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
}

/* ─── Forced choice options ─── */

.options { margin: 8px 0 4px; }

.option {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 14px 48px;
  margin-bottom: 10px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  position: relative;
  line-height: 1.55;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.option:hover {
  background: #EAF2F6;
  border-color: var(--accent);
}

.option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.option-letter {
  position: absolute;
  left: 16px;
  top: 14px;
  font-weight: 700;
  color: var(--dark);
}

.option.selected {
  background: var(--soft);
  border-color: var(--accent);
}

/* ─── Checklist (multi-tick questions) ─── */

.checklist { margin: 8px 0 16px; }

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  cursor: pointer;
  line-height: 1.55;
  transition: background 0.15s, border-color 0.15s;
}

.checklist-item:hover {
  background: #EAF2F6;
  border-color: var(--accent);
}

.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent);
  margin: 2px 0 0;
  flex-shrink: 0;
}

.checklist-item span {
  flex: 1;
  color: var(--text);
}

.checklist-item.checked {
  background: var(--soft);
  border-color: var(--accent);
}

/* ─── Reflection input ─── */

.reflection-input {
  width: 100%;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-soft);
  resize: vertical;
}

.reflection-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #EAF2F6;
}

/* ─── Buttons ─── */

.btn {
  background: var(--dark);
  color: #fff;
  border: 0;
  padding: 14px 28px;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.btn:hover { background: var(--darker); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #BBB; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--soft); color: var(--dark); }

.btn-back {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: inline-block;
}
.btn-back:hover { text-decoration: underline; }

.back-row {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.back-row > span {
  /* Empty placeholder when there's no back button — keeps Save right-aligned. */
  display: inline-block;
}

.btn-row { margin-top: 20px; display: flex; gap: 12px; align-items: center; }

/* ─── Progress ─── */

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 24px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 4px;
}

/* ─── Adviser line ─── */

.adviser {
  font-style: italic;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding: 4px 16px;
  margin: 16px 0;
}

/* ─── Loading state ─── */

.loading {
  text-align: center;
  padding: 48px 24px;
}

.loading-pulse {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 16px;
}

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

.loading-text {
  color: var(--dark);
  font-style: italic;
  margin: 0 0 8px;
  font-size: 17px;
}

.loading-subtext {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 460px;
  margin: 8px auto 0;
}

/* ─── Report ─── */

.report {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 40px 32px;
  box-shadow: var(--shadow);
}

.report h1 {
  font-family: 'Georgia', 'Cambria', serif;
  font-size: 28px;
  color: var(--dark);
  margin: 0 0 16px;
}

.report h2 {
  font-family: 'Georgia', 'Cambria', serif;
  font-size: 20px;
  color: var(--dark);
  margin: 28px 0 12px;
}

.report p {
  margin: 0 0 16px;
  line-height: 1.75;
}

.report .header-line {
  background: var(--soft);
  border-left: 3px solid var(--accent);
  padding: 18px 22px;
  font-style: italic;
  margin: 0 0 28px;
  line-height: 1.7;
}

.report-cta {
  margin-top: 32px;
  padding: 24px;
  background: var(--dark);
  border-radius: var(--radius);
  color: #fff;
  text-align: center;
}

.report-cta a {
  color: var(--soft);
  text-decoration: none;
  font-weight: 600;
}

.report-cta a:hover { color: #fff; text-decoration: underline; }

/* ─── Mobile ─── */

@media (max-width: 640px) {
  .frame { padding: 16px 12px 40px; }
  .view, .report { padding: 20px 18px; }
  .brand-title { font-size: 24px; }
  .q-title { font-size: 20px; }
  .option { padding: 12px 14px 12px 42px; }
  .option-letter { left: 14px; top: 12px; }
}
