:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #22201c;
  background: #f5f4ef;
  font-size: 16px;
  line-height: 1.55;
  --ink: #22201c;
  --muted: #66635b;
  --line: #e8e5dc;
  --accent: #f8b320;
  --accent-strong: #d38b00;
  --accent-soft: #fff8e7;
  --error: #a92121;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ol, dd, fieldset { margin: 0; }
button, input, select { font: inherit; }
button, label[for], select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.container {
  width: min(100% - 64px, 1160px);
  margin-inline: auto;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  width: 80px;
  height: 80px;
  display: block;
  object-fit: contain;
}

.header-link {
  color: #5c5548;
  font-size: .875rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.layout {
  display: grid;
  grid-template-columns: 322px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-block: 36px 44px;
}

.sidebar {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: #23221f;
  border: 1px solid #23221f;
  border-radius: 24px;
  padding: 32px 29px 30px;
}

.sidebar::before, .sidebar::after {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  content: "";
  width: 165px;
  height: 150px;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.sidebar::before {
  bottom: -61px;
  right: -74px;
  background: #363026;
}

.sidebar::after {
  bottom: -109px;
  right: -23px;
  background: #413622;
  transform: rotate(60deg);
}

.context {
  color: #ffc449;
  font-size: .875rem;
  font-weight: 650;
  margin-bottom: 11px;
}

h1 {
  font-size: clamp(2.25rem, 4.4vw, 3.1rem);
  font-weight: 730;
  line-height: .99;
  letter-spacing: -.065em;
  max-width: 7em;
}

.sidebar-description {
  color: #d4d0c7;
  line-height: 1.5;
  margin-top: 15px;
}

.progress-nav {
  border-top: 1px solid #49463f;
  margin-top: 27px;
  padding-top: 19px;
}

.progress-nav ol {
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.nav-step {
  display: flex;
  gap: 11px;
  min-height: 41px;
  align-items: center;
  border-radius: 11px;
  padding: 5px 8px;
  color: #dedad2;
  font-size: .9125rem;
  line-height: 1.25;
}

.nav-step.is-current {
  background: #3a3427;
  color: #fff;
  font-weight: 650;
}

.step-number {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #625d52;
  border-radius: 8px;
  color: #ede9df;
  font-size: .8125rem;
}

.is-current .step-number {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}

.is-complete .step-number { color: #ffc449; }

.form-card {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 35px #29231008;
  border-radius: 24px;
  padding: clamp(24px, 4vw, 40px);
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.step-count {
  color: #775006;
  font-weight: 700;
  font-size: .875rem;
}

.progress-segments { display: flex; gap: 4px; }

.segment {
  width: clamp(11px, 2vw, 28px);
  height: 5px;
  border-radius: 3px;
  background: #edeae2;
}

.segment.is-current { background: var(--accent); }
.segment.is-complete { background: #62573e; }

h2 {
  font-size: clamp(1.85rem, 4.2vw, 2.65rem);
  line-height: 1.06;
  letter-spacing: -.055em;
  font-weight: 730;
  overflow-wrap: anywhere;
}

h2:focus { outline: none; }

.step-description {
  margin-top: 10px;
  color: var(--muted);
  max-width: 51ch;
}

.step-header { margin-bottom: 26px; }
.step-content { display: grid; gap: 20px; }

fieldset { padding: 0; min-width: 0; border: 0; }

legend, .block-title {
  font-size: 1rem;
  font-weight: 680;
  margin-bottom: 9px;
  padding: 0;
}

.choices, .field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
}

.field-grid { gap: 15px 14px; }
.full-width { grid-column: 1 / -1; }
.field-grid + .block-title { margin-top: 18px; }

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 13px 12px;
  min-height: 52px;
  border: 1px solid #dfdcd3;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 140ms, border-color 140ms;
}

.choice:hover { background: #faf9f6; border-color: #c8c1b3; }
.choice:has(:checked) { background: var(--accent-soft); border-color: #e6a81d; }

.choice input, .check input {
  margin: 3px 0 0;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  accent-color: #a96500;
}

.choice-title {
  display: block;
  font-size: .9375rem;
  font-weight: 650;
  line-height: 1.35;
}

.choice-note {
  display: block;
  font-size: .875rem;
  line-height: 1.35;
  color: var(--muted);
  margin-top: 3px;
}

.field, .check-group { display: grid; align-content: start; gap: 5px; min-width: 0; }
.field label { font-size: .9375rem; font-weight: 650; line-height: 1.3; }
.optional { color: var(--muted); font-size: .8125rem; font-weight: 400; }
.hint, .field-error, .source-note { font-size: .875rem; line-height: 1.4; }
.hint, .source-note { color: var(--muted); }
.field-error { color: var(--error); font-weight: 630; margin-top: 3px; }
.input[aria-invalid="true"], .file-card:has([aria-invalid="true"]) { border-color: var(--error); }
fieldset[aria-invalid="true"] .choice { border-color: #bb7474; }

.input {
  width: 100%;
  min-width: 0;
  appearance: none;
  border: 1px solid #d9d5cb;
  color: var(--ink);
  background: white;
  border-radius: 10px;
  min-height: 46px;
  padding: 9px 11px;
}

.input::placeholder { color: #757167; opacity: 1; }
.input[list] { appearance: auto; }
select.input {
  background-image: linear-gradient(45deg, transparent 50%, #5e594f 50%), linear-gradient(135deg, #5e594f 50%, transparent 50%);
  background-position: right 16px center, right 11px center;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  padding-right: 30px;
}

.input:disabled { background-color: #f5f4f1; color: var(--muted); }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  line-height: 1.45;
}

.check-group { border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.inline-note { color: var(--muted); line-height: 1.45; }

.files { display: grid; gap: 10px; }
.file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 16px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.file-actions { display: flex; align-items: center; gap: 7px; }
.file-label { white-space: nowrap; }
.file-name { overflow-wrap: anywhere; font-size: .875rem; margin-top: 3px; }
.file-card .field-error { grid-column: 1 / -1; }
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.file-input:focus-visible + .file-label,
:is(button, input, select):focus-visible {
  outline: 2px solid #805100;
  outline-offset: 3px;
}

.summary-section {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.summary-header .block-title { margin: 0; }
.summary-section dl { display: grid; gap: 7px; margin: 0; }
.summary-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 10px; }
.summary-row dt { color: var(--muted); }
.summary-row dd { overflow-wrap: anywhere; }

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  margin-top: 23px;
}

.form-actions .primary { margin-left: auto; }
.form-actions [role="alert"] { width: 100%; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 15px;
  min-height: 46px;
  font-weight: 680;
  line-height: 1.2;
  color: var(--ink);
  background: #fff;
  transition: background-color 140ms;
  cursor: pointer;
}

.button:disabled { cursor: wait; opacity: .7; }
.primary { background: var(--accent); min-width: 150px; }
.primary:hover { background: #ffbd37; }
.secondary { border-color: #d9d5cb; }
.secondary:hover { background: #f4f2ed; }
.compact { min-height: 39px; padding: 7px 9px; font-size: .875rem; }
.text-button { border-color: transparent; color: #775006; min-height: 37px; }
.text-button:hover { background: var(--accent-soft); }
.confirmation { border: 1px solid #e5c879; background: var(--accent-soft); border-radius: 12px; padding: 15px; }
.confirmation strong { display: block; }

@media (max-width: 900px) {
  .container { width: min(100% - 40px, 1160px); }
  .layout { grid-template-columns: 245px minmax(0, 1fr); gap: 15px; }
  .sidebar { padding: 25px 18px; }
}

@media (max-width: 690px) {
  .container { width: calc(100% - 28px); }
  .header-inner { min-height: 64px; }
  .logo { width: 64px; height: 64px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding-block: 13px 25px; gap: 12px; }
  .sidebar, .form-card { border-radius: 17px; }
  .sidebar { padding: 17px 17px 19px; }
  .context { margin-bottom: 5px; }
  h1 { max-width: none; font-size: 2.1rem; }
  .sidebar-description { margin-top: 7px; }
  .progress-nav { display: none; }
  .form-card { padding: 20px 16px; }
  .progress-row { margin-bottom: 12px; }
  .step-header { margin-bottom: 21px; }
}

@media (max-width: 420px) {
  .choices, .field-grid { grid-template-columns: minmax(0, 1fr); }
  .file-card { grid-template-columns: minmax(0, 1fr); }
  .summary-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
