:root {
  --ink: #17322f;
  --ink-soft: #4a625e;
  --paper: #fbfcfb;
  --soft: #eef4f2;
  --line: #cfdedb;
  --brand: #1f5a54;
  --brand-dark: #153f3b;
  --white: #ffffff;
  --danger: #8b2f2f;
  --shadow: 0 16px 45px rgba(24, 61, 57, 0.10);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.58;
}
button, input, textarea, select { font: inherit; }
a { color: var(--brand-dark); }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.page-width,
.header-inner,
.footer-inner {
  width: min(1120px, calc(100% - 36px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(23, 50, 47, 0.08);
  background: rgba(251, 252, 251, 0.94);
  backdrop-filter: blur(14px);
}
.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--white);
  background: var(--brand);
}
nav { display: flex; gap: 22px; }
nav a { color: var(--ink); text-decoration: none; font-weight: 650; }
nav a:hover, nav a:focus { text-decoration: underline; text-underline-offset: 4px; }

.hero {
  padding: 78px 0 54px;
  background: linear-gradient(180deg, #f4f8f7 0%, var(--paper) 100%);
}
.hero-inner { max-width: 920px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.03em; }
h1 { margin: 0; font-size: clamp(2.35rem, 6vw, 4.65rem); }
h2 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.9rem); }
h3 { font-size: 1.28rem; }
.hero-lede { max-width: 780px; margin: 22px 0 0; font-size: clamp(1.18rem, 2vw, 1.52rem); }
.hero p:not(.eyebrow):not(.hero-lede) { max-width: 760px; }

.action-row,
.form-actions,
.summary-actions,
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.action-row { margin-top: 28px; }
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 760;
}
.button-primary { color: var(--white); background: var(--brand); }
.button-primary:hover, .button-primary:focus { background: var(--brand-dark); }
.button-secondary { color: var(--ink); background: var(--white); border-color: var(--line); }
.button-secondary:hover, .button-secondary:focus { border-color: var(--brand); }
.text-button {
  min-height: 42px;
  border: 0;
  padding: 8px 10px;
  color: var(--brand-dark);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.text-button.danger { color: var(--danger); }

.privacy-box,
.finish-note,
.wide-next {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}
.privacy-box p:last-child,
.finish-note p:last-child,
.wide-next p:last-child { margin-bottom: 0; }

.app-section { padding: 32px 0 72px; }
.app-panel {
  max-width: 980px;
  margin-inline: auto;
  padding: clamp(22px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}
.status-message {
  max-width: 980px;
  margin: 0 auto 16px;
  padding: 14px 18px;
  border-radius: 12px;
  background: #fff5d9;
  color: #684d00;
}
.status-message:empty { display: none; }
.status-message.success { background: #e7f4ec; color: #245d3c; }

.form-heading,
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}
.step-count { margin: 4px 0 0; color: var(--ink-soft); font-weight: 700; }
.progress {
  height: 8px;
  margin: 24px 0 34px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}
.progress span { display: block; width: 16.67%; height: 100%; background: var(--brand); transition: width 180ms ease; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin: 0 0 10px; padding: 0; font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 780; line-height: 1.2; }
.field-help { margin: 0 0 26px; color: var(--ink-soft); }
label, .question-label { display: block; margin: 24px 0 8px; font-weight: 740; }
.optional { color: var(--ink-soft); font-size: 0.9em; font-weight: 500; }
input[type="text"], textarea, select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #afc3bf;
  border-radius: 12px;
  color: var(--ink);
  background: var(--white);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus, a:focus {
  outline: 3px solid rgba(31, 90, 84, 0.24);
  outline-offset: 2px;
}
.field-error { margin: 7px 0 0; color: var(--danger); font-weight: 700; }
.question-block { margin-top: 24px; }
.question-block .question-label { margin-top: 0; }
.choice-row, .choice-grid { display: grid; gap: 10px; }
.choice-row { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.choice-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.choice-row label, .choice-grid label {
  margin: 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 52px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfc;
  font-weight: 600;
}
.choice-row label:has(input:checked), .choice-grid label:has(input:checked) {
  border-color: var(--brand);
  background: #eaf4f1;
}
.choice-row input, .choice-grid input { margin-top: 4px; flex: 0 0 auto; }
.form-actions { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }

.entry-list { display: grid; gap: 15px; margin-top: 28px; }
.entry-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfc;
}
.entry-card h3 { margin: 0; }
.entry-meta { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.92rem; }
.entry-summary { margin: 14px 0; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.entry-actions .button { min-height: 40px; padding: 8px 14px; font-size: 0.94rem; }
.pending-badge {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff1c9;
  color: #6b4b00;
  font-size: 0.84rem;
  font-weight: 760;
}
.empty-state { margin: 28px 0 0; padding: 24px; border-radius: 14px; background: var(--soft); }
.dashboard-actions { margin-top: 26px; }

.summary { margin-top: 26px; }
.summary-section { padding: 20px 0; border-top: 1px solid var(--line); }
.summary-section:first-child { border-top: 0; padding-top: 0; }
.summary-section h3 { margin: 0 0 10px; }
.summary-section dl { margin: 0; display: grid; grid-template-columns: minmax(150px, 0.32fr) 1fr; gap: 8px 20px; }
.summary-section dt { color: var(--ink-soft); font-weight: 720; }
.summary-section dd { margin: 0; }
.summary-actions { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.gradus-note { margin: 24px 0 0; color: var(--ink-soft); font-size: 0.9rem; }

.plain-section { padding: 70px 0; background: var(--soft); }
.two-column { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 50px; }

.site-footer { padding: 40px 0; color: #d7e6e3; background: var(--brand-dark); }
.footer-inner { display: grid; grid-template-columns: 1fr auto auto; gap: 28px; align-items: start; }
.footer-links { display: grid; gap: 8px; }
.site-footer a { color: var(--white); }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  nav { display: none; }
  .hero { padding-top: 54px; }
  .form-heading, .panel-heading { display: block; }
  .panel-heading .button { margin-top: 18px; }
  .choice-row, .choice-grid { grid-template-columns: 1fr; }
  .two-column, .footer-inner { grid-template-columns: 1fr; }
  .summary-section dl { grid-template-columns: 1fr; gap: 3px; }
  .summary-section dd { margin-bottom: 12px; }
  .button { width: 100%; }
  .text-button { width: auto; }
}

@media print {
  .site-header, .hero, .status-message, .panel-heading button, .summary-actions, .wide-next, .plain-section, .site-footer, .gradus-note { display: none !important; }
  body { background: white; }
  .app-section { padding: 0; }
  .app-panel { max-width: none; padding: 0; border: 0; box-shadow: none; }
  #formView, #recentView { display: none !important; }
  #summaryView { display: block !important; }
}
