:root {
  --ink: #24303b;
  --muted: #66727d;
  --paper: #fbfaf7;
  --card: #ffffff;
  --line: #dbe0e3;
  --blue: #315b72;
  --blue-dark: #214254;
  --blue-soft: #eaf1f4;
  --gold: #b9893d;
  --gold-soft: #fbf3e5;
  --green: #2f6a57;
  --green-soft: #eaf5ef;
  --red: #9d4741;
  --red-soft: #fbefed;
  --shadow: 0 18px 46px rgba(36, 48, 59, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at top right, #edf3f4 0, var(--paper) 42rem), var(--paper);
  line-height: 1.55;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.site-header, .site-footer {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header { padding: 26px 0 10px; }
.site-footer { padding: 24px 0 34px; color: var(--muted); font-size: 0.85rem; }
.brand-mark { letter-spacing: 0.16em; font-size: 0.75rem; font-weight: 800; color: var(--blue); }
.header-status { color: var(--muted); font-size: 0.85rem; }

.app-shell { width: min(900px, calc(100% - 36px)); margin: 0 auto; min-height: 78vh; }
.auth-shell { width: min(620px, calc(100% - 36px)); margin: 0 auto; min-height: 78vh; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 30px; margin: 48px auto; }
.auth-card h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; margin: 22px 0; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.auth-form { margin-top: 18px; }
.auth-form .field { margin: 14px 0; }
.auth-form input[type="email"], .auth-form input[type="password"] { width: 100%; border: 1px solid #bdc7cd; border-radius: 10px; padding: 13px 14px; color: var(--ink); background: #fff; }
.auth-form button { width: 100%; margin-top: 8px; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.auth-message { margin-top: 16px; }
.auth-message:empty { display: none; }
.auth-message.error { margin-top: 16px; }
.auth-message.success { margin-top: 16px; }
.screen { padding: 38px 0 50px; }
.hero { max-width: 760px; margin: 0 auto; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.72rem; font-weight: 800; margin: 0 0 16px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 16px; }
h1 { font-size: clamp(2.1rem, 5vw, 4.2rem); max-width: 760px; }
h2 { font-size: clamp(1.65rem, 3vw, 2.5rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 16px; }
.lead { color: #46545f; font-size: 1.12rem; max-width: 720px; }
.small { color: var(--muted); font-size: 0.9rem; }

.intro-card, .question-card, .review-card, .report-card, .path-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.intro-card { padding: 26px; margin-top: 28px; }
.intro-card + .intro-card { margin-top: 14px; }
.callout { border-left: 4px solid var(--gold); background: var(--gold-soft); padding: 16px 18px; border-radius: 10px; margin: 20px 0; }
.callout strong { display: block; margin-bottom: 4px; }

.field { margin: 24px 0; }
.field label, .field legend { display: block; font-weight: 750; margin-bottom: 8px; }
.field legend { padding: 0; }
.field fieldset { border: 0; padding: 0; margin: 0; }
textarea, input[type="text"], select {
  width: 100%;
  border: 1px solid #bdc7cd;
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 112px; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: 3px solid rgba(49, 91, 114, 0.18); border-color: var(--blue); }
.helper { color: #56636e; font-size: 0.93rem; margin: 0 0 11px; }
.example { color: #455b65; background: var(--blue-soft); border-radius: 10px; padding: 12px 14px; font-size: 0.91rem; margin-top: 10px; }
.example strong { color: var(--blue-dark); }
.more-examples { margin-top: 12px; border: 1px solid #d7e0e4; border-radius: 10px; background: #f8fbfc; padding: 10px 13px; color: #52636b; font-size: 0.9rem; }
.more-examples summary { cursor: pointer; color: var(--blue-dark); font-weight: 750; }
.more-examples ul { margin: 10px 0 2px 18px; padding: 0; }
.more-examples li { margin: 7px 0; }
.more-examples strong { color: var(--blue-dark); }
.question-number { color: var(--gold); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; }

.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
.path-card { padding: 20px; text-align: left; border: 2px solid var(--line); box-shadow: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.path-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(36, 48, 59, .08); }
.path-card.selected { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(49, 91, 114, .12); }
.path-card h3 { color: var(--blue-dark); }
.path-card p { color: var(--muted); font-size: 0.92rem; }
.path-card .path-example { font-size: 0.84rem; color: #53636a; border-top: 1px solid var(--line); padding-top: 12px; }

.progress-wrap { margin: 10px 0 30px; }
.progress-line { height: 7px; background: #e5e9eb; border-radius: 99px; overflow: hidden; }
.progress-line > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--gold)); border-radius: inherit; transition: width .2s; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.84rem; margin-top: 8px; }

.section-intro { margin-bottom: 22px; }
.section-intro p { color: #52606b; max-width: 720px; }
.question-card { padding: 24px; margin-bottom: 16px; box-shadow: 0 8px 22px rgba(36, 48, 59, .05); }
.question-card .field { margin: 0; }
.required { color: var(--red); font-size: 0.8rem; margin-left: 5px; }

.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; }
.actions-right { display: flex; gap: 10px; margin-left: auto; }
button.primary, button.secondary, button.ghost, button.danger {
  border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 750; transition: transform .15s, box-shadow .15s, background .15s;
}
button.primary { background: var(--blue); color: white; box-shadow: 0 8px 18px rgba(49, 91, 114, .2); }
button.primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
button.secondary { background: var(--green); color: #fff; }
button.secondary:hover { background: #245542; transform: translateY(-1px); }
button.ghost { background: transparent; border: 1px solid #b8c4c9; color: var(--blue-dark); }
button.ghost:hover { background: var(--blue-soft); }
button.danger { background: var(--red-soft); color: var(--red); }
.text-button { color: var(--muted); background: none; border: 0; text-decoration: underline; padding: 0; }
.error { color: var(--red); background: var(--red-soft); border-radius: 10px; padding: 11px 13px; margin-top: 14px; }

.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.review-card { padding: 22px; box-shadow: 0 8px 22px rgba(36, 48, 59, .05); }
.review-card.full { grid-column: 1 / -1; }
.review-card h3 { color: var(--blue-dark); }
.review-card textarea { min-height: 120px; }
.status-pill { display: inline-block; border-radius: 99px; padding: 5px 10px; background: var(--green-soft); color: var(--green); font-size: 0.78rem; font-weight: 800; }
.review-note { background: var(--gold-soft); border-radius: 12px; padding: 15px 17px; margin: 18px 0; }
.clarify-list { margin: 8px 0 0 20px; color: #5c4b2e; }

.report-card { padding: 30px; margin-top: 22px; }
.report-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; }
.report-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.report-section h3 { margin-bottom: 8px; }
.report-quote { border-left: 4px solid var(--blue); padding: 12px 16px; background: var(--blue-soft); border-radius: 0 10px 10px 0; white-space: pre-wrap; }
.report-list { margin: 8px 0 0 20px; }
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.success { color: var(--green); background: var(--green-soft); border-radius: 10px; padding: 12px 14px; margin-top: 18px; }
.muted-box { color: var(--muted); border: 1px dashed #b9c5ca; border-radius: 10px; padding: 13px 14px; }

@media (max-width: 720px) {
  .site-header, .site-footer, .app-shell, .auth-shell { width: min(100% - 24px, 900px); }
  .site-header { padding-top: 18px; }
  .screen { padding-top: 24px; }
  .path-grid, .review-grid { grid-template-columns: 1fr; }
  .review-card.full { grid-column: auto; }
  .actions { align-items: stretch; flex-direction: column-reverse; }
  .actions-right { margin-left: 0; width: 100%; }
  .actions button { width: 100%; }
  .actions-right button { flex: 1; }
}

@media print {
  body { background: white; }
  .site-header, .site-footer, .no-print, button { display: none !important; }
  .app-shell { width: 100%; }
  .screen { padding: 0; }
  .report-card { box-shadow: none; border: 0; padding: 0; }
  .report-section { break-inside: avoid; }
}
