:root {
  --ink: #12192b;
  --ink-soft: #5c6274;
  --paper: #faf9f5;
  --card: #ffffff;
  --line: #e6e2d3;
  --navy: #12192b;
  --gold: #c4a834;
  --gold-soft: #f8f1db;
  --danger: #b3492f;
  --radius: 12px;
  --font-header: "DM Serif Display", Georgia, serif;
  --font-body: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

/* Embedded in an iframe: let the page be exactly as tall as its content, so the
   height we report to the parent can shrink as well as grow. */
html.embedded body { min-height: 0; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-header); font-weight: 400; line-height: 1.25; }

.hidden { display: none !important; }

#app { max-width: 760px; margin: 0 auto; padding: 32px 20px 80px; }

/* Logo */
.brand-logo { height: 64px; width: auto; display: block; margin: 0 auto 20px; }
.brand-logo-small { height: 40px; margin: 0 auto 20px; }

/* Landing */
.landing-inner { text-align: center; padding: 32px 0 24px; }
.landing h1 { font-size: 2.2rem; margin: 8px 0 16px; color: var(--navy); }
.landing-lede { color: var(--ink-soft); font-size: 1.05rem; max-width: 560px; margin: 0 auto 20px; }
.landing-points { list-style: none; padding: 0; margin: 0 auto 32px; display: inline-block; text-align: left; color: var(--ink-soft); font-weight: 400; }
.landing-points li { padding: 4px 0 4px 24px; position: relative; }
.landing-points li::before { content: "✓"; position: absolute; left: 0; color: var(--gold); font-weight: 700; }

/* Buttons */
.btn { border: none; border-radius: 999px; padding: 12px 22px; font-size: 0.95rem; font-weight: 600; font-family: var(--font-body); cursor: pointer; transition: opacity 0.15s ease, transform 0.15s ease; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover:not(:disabled) { opacity: 0.88; }
.btn-secondary { background: var(--card); color: var(--navy); border: 1px solid var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--navy); }
.btn-large { padding: 14px 30px; font-size: 1.05rem; }

/* Progress */
.progress-wrap { margin-bottom: 24px; }
.progress-bar-track { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--gold); transition: width 0.2s ease; }
.progress-text { font-size: 0.85rem; color: var(--ink-soft); margin: 8px 0 0; }

/* Form */
.form-section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.section-title { margin-top: 0; color: var(--navy); }
.section-intro { color: var(--ink-soft); }

.field { margin-bottom: 22px; }
.field.invalid .field-label { color: var(--danger); }
.field.invalid .input,
.field.invalid .option-group { border-color: var(--danger); }
.field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.field-helper { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 8px; }

.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 0.95rem; font-family: inherit; background: #fff; color: var(--ink); }
.textarea { resize: vertical; }
.other-input { margin-top: 8px; }

.option-group { display: flex; flex-direction: column; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 2px; }
.option-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.option-row:hover { border-color: var(--navy); }
.option-row input { width: 16px; height: 16px; accent-color: var(--navy); }

.scale-row { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.scale-btn { width: 100%; aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-family: var(--font-body); color: var(--ink); }
.scale-btn.selected { background: var(--navy); color: #fff; border-color: var(--navy); }
.scale-labels { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }

.form-nav { display: flex; justify-content: space-between; margin-top: 20px; }

/* Calendar screenshot widget */
.calendar-preview { margin-top: 12px; }
.calendar-screenshot { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }

/* Report */
.report-content { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.report-header { text-align: center; margin-bottom: 28px; }
.report-header h1 { color: var(--navy); }
.report-subtitle { color: var(--ink-soft); }
.overall-score { margin-top: 16px; display: inline-flex; flex-direction: column; align-items: center; background: var(--gold-soft); border-radius: 16px; padding: 16px 32px; }
.overall-score-number { font-family: var(--font-header); font-size: 2.4rem; color: var(--navy); }
.overall-score-tier { font-weight: 600; color: var(--navy); }

.report-section-title { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 24px; color: var(--navy); }

.priorities-list { display: flex; flex-direction: column; gap: 14px; }
.priority-card { display: flex; gap: 14px; background: var(--gold-soft); border-radius: 10px; padding: 16px 18px; }
.priority-number { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.priority-body h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--navy); }
.priority-category { color: var(--ink-soft); font-size: 0.8rem; margin: 0 0 6px; }
.priority-reframe { margin: 0; }

.categories-list { display: flex; flex-direction: column; gap: 14px; }
.category-row-top { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 4px; }
.category-label { font-weight: 500; }
.category-tier { color: var(--ink-soft); }
.category-bar-track { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.category-bar-fill { height: 100%; background: var(--navy); }

.strengths-list { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.strengths-list li { position: relative; padding-left: 26px; }
.strengths-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--gold); font-weight: 700; }

.patterns-list { display: flex; flex-direction: column; gap: 12px; }
.pattern-item { margin: 0; padding: 12px 16px; border-left: 3px solid var(--gold); background: #fcfaf4; border-radius: 0 8px 8px 0; }

.time-lost { background: var(--navy); color: #fff; border-radius: 12px; padding: 20px 24px; }
.time-lost-headline { margin: 0; }
.time-lost-figure { font-family: var(--font-header); font-size: 2rem; color: var(--gold); }
.time-lost-unit { font-size: 1rem; color: #fff; }
.time-lost-drivers { margin: 6px 0 0; color: #e8e6df; }
.time-lost-annual { margin: 10px 0 0; font-size: 0.85rem; color: #b9bcc4; }

.readiness { margin-top: 20px; padding: 16px 18px; background: var(--gold-soft); border-radius: 10px; font-weight: 500; }

.report-calendar { margin-top: 10px; }

.cta-card { margin-top: 28px; background: var(--gold-soft); border-radius: 12px; padding: 22px; text-align: center; }
.cta-card h3 { margin-top: 0; color: var(--navy); }
.cta-qualified { background: linear-gradient(135deg, var(--gold-soft), #fff); border: 1px solid var(--gold); }

.report-actions { margin-top: 24px; text-align: center; }

@media (max-width: 600px) {
  .landing h1 { font-size: 1.7rem; }
  .form-section, .report-content { padding: 20px; }
  .brand-logo { height: 48px; }
  .scale-row { gap: 4px; }
  .scale-btn { font-size: 0.85rem; }
}

/* Tuned to land the whole report on two printed pages. */
@media print {
  @page { size: letter; margin: 0.45in; }

  body { background: #fff; font-size: 10pt; line-height: 1.35; }
  .no-print { display: none !important; }
  #app { max-width: 100%; padding: 0; }
  .report-content { border: none; padding: 0; border-radius: 0; }

  .brand-logo-small { height: 30px; margin-bottom: 8px; }
  .report-header { margin-bottom: 12px; }
  .report-header h1 { font-size: 19pt; margin: 0 0 2px; }
  .report-subtitle { margin: 0; font-size: 9pt; }
  .overall-score { margin-top: 8px; padding: 8px 22px; border-radius: 10px; }
  .overall-score-number { font-size: 20pt; }
  .overall-score-tier { font-size: 9pt; }

  .report-section-title { font-size: 12.5pt; padding-top: 7px; margin: 9px 0 6px; }

  .priorities-list, .categories-list, .patterns-list { gap: 7px; }
  .priority-card { padding: 9px 12px; gap: 10px; }
  .priority-number { width: 22px; height: 22px; font-size: 9pt; }
  .priority-body h3 { font-size: 10.5pt; margin-bottom: 2px; }
  .priority-category { font-size: 8pt; margin-bottom: 3px; }

  .strengths-list { gap: 5px; }
  .pattern-item { padding: 7px 12px; }

  .time-lost { padding: 12px 16px; }
  .time-lost-figure { font-size: 16pt; }
  .time-lost-annual { font-size: 8pt; margin-top: 6px; }

  .category-row { margin: 0; }
  .category-row-top { font-size: 9pt; margin-bottom: 2px; }
  .category-bar-track { height: 6px; }

  .readiness { margin-top: 12px; padding: 10px 14px; }
  .cta-card { margin-top: 12px; padding: 14px; }
  .cta-card h3 { font-size: 12pt; }

  /* The uploaded screenshot is the one element that can blow the page budget. */
  .calendar-screenshot { max-height: 1.9in; width: auto; max-width: 100%; }

  /* No forced breaks: the report is sized to flow onto exactly two pages, and
     letting it flow naturally survives varying answer lengths better than a
     hard break that can strand half a page of whitespace. */
  .priority-card, .cta-card, .pattern-item, .time-lost, .readiness,
  .strengths-list li, .category-row, .report-header { break-inside: avoid; }
  .report-section-title { break-after: avoid; }
}
