:root {
  --bg: #f7f7f3;
  --surface: #ffffff;
  --ink: #20211f;
  --muted: #666c61;
  --line: #d8ddd3;
  --accent: #176c63;
  --accent-dark: #0f4f49;
  --result: #f4f3ee;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

.page {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: block;
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--line);
}

.hero > div {
  max-width: 760px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 20px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.16;
  letter-spacing: 0;
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
}

.secondary-link,
.cta,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.secondary-link:disabled,
.cta:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-link:hover,
.cta:hover,
button:hover {
  background: var(--accent-dark);
}

.secondary-link:disabled:hover,
.cta:disabled:hover,
button:disabled:hover {
  background: var(--accent);
}

.diagnosis,
.result {
  margin-top: 28px;
}

.step-progress {
  margin: 24px 0 0;
}

.step-progress ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-progress li {
  position: relative;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px 10px 38px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.step-progress li::before {
  content: attr(data-step-indicator);
  position: absolute;
  left: 10px;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #edf5f1;
  color: var(--accent);
  font-size: 0.78rem;
}

.step-progress li.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.step-progress li.is-active::before {
  background: #fff;
  color: var(--accent);
}

.step-progress li.is-complete {
  border-color: #b9d4cc;
  color: var(--accent-dark);
}

.diagnosis {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgb(32 33 31 / 0.08);
}

.intro-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.hero .intro-fields {
  max-width: 720px;
  margin: 28px auto 0;
}

.hero > .secondary-link {
  display: flex;
  width: fit-content;
  margin: 20px 0 0 auto;
}

.consent-check {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 0.94rem;
}

.consent-check input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--accent);
}

.consent-check span {
  margin: 0;
  font-weight: 600;
}

.start-help {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.start-help.is-ready {
  color: var(--accent-dark);
  font-weight: 700;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

.category-list {
  display: grid;
  gap: 18px;
}

.category {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.category h2 {
  margin-bottom: 16px;
  font-size: 1.18rem;
}

.check-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid #ecefea;
}

.check-item:first-of-type {
  border-top: 0;
}

.check-item input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--accent);
}

.free-comment {
  margin-top: 22px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  margin-top: 0;
}

.step-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.step-navigation {
  display: flex;
  flex: 1 1 auto;
  justify-content: flex-start;
  gap: 12px;
}

[data-step-next] {
  margin-left: auto;
}

.step-nav-button {
  min-width: 132px;
}

.step-nav-button-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent-dark);
}

.step-nav-button-secondary:hover {
  border-color: var(--accent);
  background: #edf5f1;
  color: var(--accent-dark);
}

#save-status {
  margin-bottom: 0;
  color: var(--muted);
}

.result .cta {
  display: flex;
  order: 5;
  width: fit-content;
  margin-top: 20px;
  margin-left: auto;
}

.result {
  display: flex;
  flex-direction: column;
  background: var(--result);
  border: 1px solid #cddfd7;
  border-left: 8px solid var(--result-accent, var(--accent));
  border-radius: 8px;
  padding: 24px;
}

.result[data-result="current_ok"] {
  --result-accent: #2f855a;
}

.result[data-result="improvement_possible"] {
  --result-accent: #2563eb;
}

.result[data-result="consultation_recommended"] {
  --result-accent: #d97706;
}

.result[data-result="implementation_recommended"] {
  --result-accent: #dc2626;
}

.result .cta-note {
  order: 4;
}

.result-header h2 {
  margin-bottom: 8px;
  font-size: 1.8rem;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.score-grid div {
  min-height: 92px;
  border: 1px solid #cddfd7;
  border-radius: 6px;
  padding: 14px;
  background: #fff;
}

.score-grid span {
  display: block;
  min-height: 42px;
  color: var(--muted);
  font-size: 0.9rem;
}

.score-grid strong {
  font-size: 1.45rem;
}

.focus {
  margin-bottom: 20px;
}

.focus h3 {
  margin-bottom: 8px;
}

.cta-note {
  width: 100%;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 24px, 1040px);
    padding-top: 18px;
  }

  .hero,
  .actions,
  .step-navigation,
  .step-controls {
    display: block;
  }

  .hero .secondary-link,
  .actions button,
  .step-navigation button,
  .step-controls button {
    width: 100%;
    margin-top: 18px;
  }

  .intro-fields,
  .score-grid,
  .step-progress ol {
    grid-template-columns: 1fr;
  }

  .category {
    padding: 16px;
  }
}
