/* ============================================================
   PPN Transition Companion — Stylesheet
   Aesthetic: calm, clinical, trustworthy. Warm sage + bone palette.
   Type pairing: Fraunces (humanist serif) for display,
                 Plus Jakarta Sans for UI.
   ============================================================ */

:root {
  /* Palette */
  --bone:        #FAF7F1;   /* page background */
  --paper:       #FFFFFF;   /* card background */
  --ink:         #1F2A2E;   /* primary text */
  --ink-soft:    #3F4D52;
  --muted:       #6B7A80;
  --line:        #E3DCCD;   /* warm border */
  --line-strong: #C9BFA9;
  --sage-50:     #ECF1EA;
  --sage-100:    #D8E3D4;
  --sage-300:    #91B097;
  --sage-500:    #4F7857;   /* primary accent */
  --sage-700:    #335240;
  --terracotta:  #B85C3F;   /* warm accent for CTAs/highlights */
  --terracotta-soft: #F5E5DD;
  --gold:        #C4A659;
  --danger:      #9B2B1B;
  --danger-soft: #F4E1DC;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(31, 42, 46, 0.04), 0 1px 1px rgba(31, 42, 46, 0.06);
  --shadow-md: 0 6px 22px rgba(31, 42, 46, 0.06), 0 2px 6px rgba(31, 42, 46, 0.04);
  --shadow-lg: 0 24px 48px rgba(31, 42, 46, 0.08);

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
  --r-xl: 28px;

  /* Type */
  --display: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;
  --body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  /* Subtle paper-grain background using two layered radial gradients */
  background-image:
    radial-gradient(at 18% 12%, rgba(196, 166, 89, 0.06) 0%, transparent 40%),
    radial-gradient(at 82% 78%, rgba(79, 120, 87, 0.05) 0%, transparent 45%);
  min-height: 100vh;
}

a { color: var(--sage-700); }
a:hover { color: var(--terracotta); }

button { font-family: inherit; cursor: pointer; }

/* ============ Screens (the SPA "pages") ============ */
.screen { display: none; }
.screen.active {
  display: block;
  animation: fadeUp 0.5s ease-out;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ LANDING ============ */
.landing-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 32px 80px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 48px 72px;
}
.landing-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--sage-700); }
.brand-mark { width: 32px; height: 32px; }
.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.deadline-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--terracotta-soft);
  color: var(--terracotta);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.deadline-chip .dot {
  width: 7px; height: 7px;
  background: var(--terracotta);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

.hero { padding-top: 24px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 600;
  color: var(--sage-500);
  margin: 0 0 24px;
}
.display {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(38px, 5.2vw, 62px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 28px;
  font-variation-settings: 'opsz' 144;
}
.display em {
  font-style: italic;
  font-weight: 400;
  color: var(--sage-700);
}
.display .accent {
  color: var(--terracotta);
  position: relative;
  white-space: nowrap;
}
.display .accent::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -2px;
  height: 6px;
  background: var(--terracotta-soft);
  z-index: -1;
  border-radius: 2px;
}
.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 36px;
  max-width: 58ch;
}
.cta-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cta-note { color: var(--muted); font-size: 14px; }

.hero-aside { display: flex; flex-direction: column; gap: 28px; padding-top: 56px; }
.aside-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.aside-card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 18px;
  color: var(--sage-700);
  letter-spacing: -0.01em;
}
.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.check-list li {
  display: flex;
  gap: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.check-list li::before {
  content: '';
  flex: 0 0 18px;
  height: 18px;
  margin-top: 3px;
  background: var(--sage-100);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / contain no-repeat;
  background-color: var(--sage-500);
}

.aside-quote {
  border-left: 3px solid var(--sage-300);
  padding-left: 22px;
  position: relative;
}
.aside-quote .quote-mark {
  font-family: var(--display);
  font-size: 70px;
  line-height: 0.6;
  color: var(--sage-300);
  position: absolute;
  left: -3px;
  top: -8px;
  font-weight: 600;
}
.aside-quote p {
  font-family: var(--display);
  font-style: italic;
  font-size: 17px;
  line-height: 1.45;
  margin: 0 0 12px;
  color: var(--ink-soft);
}
.aside-quote cite {
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  border: none;
  font-family: var(--body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--sage-700);
  color: white;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  background: var(--sage-500);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  background: var(--line-strong);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--sage-700);
  border: 1.5px solid var(--line-strong);
}
.btn-ghost:hover {
  background: var(--sage-50);
  border-color: var(--sage-500);
  color: var(--sage-700);
}
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.arrow { transition: transform 0.2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ============ FORM ============ */
.form-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}
.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 24px;
}
.back-link {
  background: none;
  border: none;
  color: var(--sage-700);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 0;
}
.back-link:hover { color: var(--terracotta); }

.progress {
  display: flex; align-items: center; gap: 14px;
  flex: 1;
  max-width: 360px;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--sage-50);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sage-500), var(--sage-700));
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 14.3%; /* 1/7 default */
}
.progress-text { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Steps */
.step { display: none; }
.step.active {
  display: block;
  animation: stepIn 0.4s ease-out;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--sage-500);
  margin: 0 0 12px;
}
.step-title {
  font-family: var(--display);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--ink);
  font-variation-settings: 'opsz' 96;
}
.step-help {
  color: var(--muted);
  font-size: 15.5px;
  margin: 0 0 36px;
  max-width: 60ch;
}

/* Fields */
.field { margin-bottom: 22px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}
.field label, .choice-label {
  display: block;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.005em;
}
.choice-label {
  font-size: 15.5px;
  margin-bottom: 14px;
}
.field-help {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0;
}

input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  transition: all 0.2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--sage-500);
  box-shadow: 0 0 0 4px rgba(79, 120, 87, 0.12);
}
input::placeholder, textarea::placeholder { color: #A8B2B6; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234F7857' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

textarea { resize: vertical; min-height: 80px; }

/* Pill buttons (for yes/no/unsure-type questions) */
.choice-field { margin-bottom: 30px; }
.choice-grid { display: flex; flex-direction: column; gap: 4px; }

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pill {
  padding: 11px 20px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: all 0.18s ease;
}
.pill:hover {
  border-color: var(--sage-300);
  background: var(--sage-50);
}
.pill.selected {
  background: var(--sage-700);
  border-color: var(--sage-700);
  color: white;
  font-weight: 600;
}

/* Big options (radio-style cards for important questions) */
.big-options {
  display: grid;
  gap: 12px;
}
.big-option {
  text-align: left;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.18s ease;
}
.big-option strong {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.big-option span {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}
.big-option:hover {
  border-color: var(--sage-300);
  background: var(--sage-50);
  transform: translateX(2px);
}
.big-option.selected {
  border-color: var(--sage-700);
  background: var(--sage-50);
  box-shadow: 0 0 0 3px rgba(79, 120, 87, 0.12);
}
.big-option.selected strong { color: var(--sage-700); }

.size-readout {
  margin-top: 12px;
  padding: 14px 18px;
  background: var(--sage-50);
  border-left: 3px solid var(--sage-300);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* Nav */
.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  gap: 16px;
}
.form-nav .btn-primary { margin-left: auto; }

/* ============ REPORT ============ */
.report-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 32px 96px;
}
.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
  gap: 16px;
  flex-wrap: wrap;
}
.report-actions { display: flex; gap: 10px; }

#report-body section { margin-bottom: 56px; }
#report-body .report-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 700;
  color: var(--sage-500);
  margin-bottom: 8px;
}
#report-body h1 {
  font-family: var(--display);
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 12px;
  color: var(--ink);
  font-variation-settings: 'opsz' 144;
}
#report-body h2 {
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--sage-700);
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
#report-body h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 8px 0 4px;
  color: var(--ink);
}
#report-body p { color: var(--ink-soft); line-height: 1.65; }
.report-meta { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

.summary-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

.risks-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.risk-item {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--terracotta);
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.risk-item.ok { border-left-color: var(--sage-500); }
.risk-item::before {
  content: '!';
  flex: 0 0 24px;
  height: 24px;
  background: var(--terracotta);
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}
.risk-item.ok::before { content: '✓'; background: var(--sage-500); }

/* Recommendation cards */
.rec {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.rec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 10px;
}
.rec-num {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--sage-300);
  font-variation-settings: 'opsz' 96;
}
.rec h3 { margin: 0; }
.rec-why {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 0 22px;
}

/* Options table */
.options {
  display: grid;
  gap: 10px;
}
.option {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr 2.4fr;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bone);
  position: relative;
  align-items: start;
}
.option.recommended {
  background: var(--sage-50);
  border-color: var(--sage-300);
  border-left: 4px solid var(--sage-500);
}
.option .opt-label { font-weight: 600; color: var(--ink); }
.option .opt-product { color: var(--ink-soft); font-size: 14.5px; font-weight: 500; }
.option .opt-spec { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.option .opt-bestfor {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--muted);
}
.opt-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--sage-500);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Timeline */
.timeline {
  border-left: 2px solid var(--sage-300);
  padding-left: 28px;
  margin-left: 8px;
  display: grid;
  gap: 26px;
}
.timeline-item { position: relative; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -36px;
  top: 4px;
  width: 14px;
  height: 14px;
  background: var(--paper);
  border: 3px solid var(--sage-500);
  border-radius: 50%;
}
.timeline-week {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  color: var(--sage-700);
  margin: 0 0 4px;
}
.timeline-action {
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
  font-size: 14.5px;
}

/* Acronyms */
.acronyms {
  columns: 2;
  column-gap: 32px;
  margin-top: 16px;
}
.acronym-item {
  break-inside: avoid;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.acronym-item strong {
  color: var(--sage-700);
  font-weight: 700;
  margin-right: 6px;
}
.acronym-item span { color: var(--ink-soft); }

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: var(--bone);
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============ Responsive ============ */
@media (max-width: 880px) {
  .landing-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 24px 20px 60px;
  }
  .hero-aside { padding-top: 0; }
  .field-row { grid-template-columns: 1fr; }
  .option { grid-template-columns: 1fr; gap: 6px; }
  .option .opt-spec { font-size: 13.5px; }
  .opt-badge { position: static; display: inline-block; margin-bottom: 8px; }
  .acronyms { columns: 1; }
  .form-shell, .report-shell { padding: 24px 20px 60px; }
  .deadline-chip { font-size: 12px; padding: 5px 11px; }
  .brand-name { display: none; }
}

@media (max-width: 520px) {
  .display { font-size: 36px; }
  .btn { padding: 12px 20px; font-size: 14px; }
  .form-nav { flex-direction: column-reverse; align-items: stretch; }
  .form-nav .btn { width: 100%; justify-content: center; }
  .form-nav .btn-primary { margin-left: 0; }
  .pill { font-size: 13.5px; padding: 9px 16px; }
}

/* ============ Print (so the report prints reasonably) ============ */
@media print {
  body { background: white; }
  .report-header, .form-shell, .landing-grid { display: none !important; }
  #report.active { display: block !important; }
  .rec, .summary-card, .risk-item { break-inside: avoid; }
}
