@font-face {
  font-family: Onest;
  src: url('/assets/fonts/onest.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Golos Text';
  src: url('/assets/fonts/golos-text.ttf') format('truetype');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --paper: #f5f4ef;
  --ink: #192323;
  --muted: #52615a;
  --accent: #912b32;
  --accent-hover: #792228;
  --field: #e6ebe4;
  --line: #d8ded6;
  --white: #fff;
  --dark: #202d29;
  --dark-muted: #c0ccc4;
  --dark-line: #54615b;
  --error: #84252b;
  --error-ground: #f7e6e6;
  --focus: #912b32;
  --radius: 4px;
  font-family: 'Golos Text', sans-serif;
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; text-underline-offset: .22em; }
img { display: block; max-width: 100%; }
input, button { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
::selection { background: var(--accent); color: var(--white); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

.shell {
  width: min(1120px, calc(100% - 64px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  color: var(--white);
  background: var(--accent);
  transform: translateY(calc(-100% - 15px));
}

.skip-link:focus { transform: none; }

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; justify-content: space-between; align-items: center; min-height: 72px; gap: 16px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: Onest, sans-serif;
  font-weight: 650;
  font-size: 1.0625rem;
  text-decoration: none;
}

.brand img { width: 40px; height: 40px; object-fit: contain; }
.home-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  color: var(--muted);
  font-size: .9375rem;
  text-decoration: none;
}
.home-link:hover { color: var(--accent); text-decoration: underline; }

.main { padding-block: 54px 70px; }
h1, h2 { margin: 0; font-family: Onest, sans-serif; font-weight: 650; }
h1 { max-width: 860px; font-size: 3.5rem; line-height: 1.06; letter-spacing: -.035em; text-wrap: balance; }
h2 { font-size: 1.75rem; line-height: 1.17; letter-spacing: -.025em; }

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 334px;
  align-items: start;
  gap: 20px;
  margin-top: 30px;
}

.wizard {
  min-width: 0;
  padding: 32px 36px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.wizard-progress { display: grid; gap: 8px; margin-bottom: 23px; }
.step-count { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
progress {
  width: 100%;
  height: 3px;
  accent-color: var(--accent);
  color: var(--accent);
  background: var(--line);
  border: 0;
}
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

.step-description { margin: 12px 0 0; max-width: 55ch; color: var(--muted); line-height: 1.55; }
.fields { display: grid; gap: 11px; margin-top: 22px; }
.options, .dimensions { margin: 0; padding: 0; border: 0; min-width: 0; }
.options { display: grid; gap: 9px; }
.dimensions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.choice {
  display: flex;
  position: relative;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  line-height: 1.4;
}
.choice:hover { background: var(--paper); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--field); }
.choice:has(input[aria-invalid="true"]) { border-color: var(--error); }
.choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

input[type="radio"], input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--accent);
}

.field { display: grid; gap: 6px; min-width: 0; }
.field label { color: var(--ink); font-size: .9375rem; font-weight: 610; }
.field-optional { margin-left: 7px; color: var(--muted); font-size: .84375rem; font-weight: 400; }
.field-box { position: relative; }
.field-box input {
  width: 100%;
  min-height: 51px;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  caret-color: var(--accent);
}
.field-box input::placeholder { color: var(--muted); opacity: 1; }
.field-box input[aria-invalid="true"] { border-color: var(--error); }
.field-box .unit { position: absolute; right: 13px; top: 16px; color: var(--muted); pointer-events: none; }
.field-box:has(.unit) input { padding-right: 40px; }
.field-error { margin: 0; color: var(--error); font-size: .875rem; line-height: 1.42; }

.consent { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding-block: 8px; color: var(--muted); line-height: 1.45; font-size: .875rem; }
.consent input { margin-top: 2px; }
.consent label { min-width: 0; color: inherit; font-size: inherit; font-weight: 400; cursor: pointer; }
.consent-links { margin: 0 0 0 28px; line-height: 1.55; font-size: .875rem; }
.consent-links a { color: var(--accent); }

.actions { display: flex; gap: 10px; margin-top: 23px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 51px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .9375rem;
  line-height: 1.28;
  font-weight: 620;
  text-align: center;
  text-decoration: none;
}
.button-primary { color: var(--white); background: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); }
.button-primary:disabled { opacity: .72; }
.button-secondary { color: var(--ink); background: var(--white); border-color: var(--line); }
.button-secondary:hover:not(:disabled) { background: var(--paper); }
.button-secondary:disabled { opacity: .65; }

.summary {
  padding: 27px 26px 28px;
  background: var(--dark);
  color: var(--white);
  border-radius: var(--radius);
}
.summary h2 { font-size: 1.35rem; }
.summary dl { margin: 14px 0 0; }
.summary dl:empty { display: none; }
.summary-row { display: grid; gap: 3px; padding: 11px 0; border-top: 1px solid var(--dark-line); }
.summary-row dt { color: var(--dark-muted); font-size: .8125rem; line-height: 1.4; }
.summary-row dd { margin: 0; line-height: 1.4; font-variant-numeric: tabular-nums; }
#summary-empty { margin: 12px 0 0; color: var(--dark-muted); line-height: 1.5; font-size: .9375rem; }

.result { background: var(--field); border-radius: var(--radius); padding: 18px 19px; margin-top: 18px; }
.result span { display: block; color: var(--muted); font-size: .9rem; }
.result output { display: block; margin-top: 4px; font: 650 2.4rem/1.12 Onest, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.result p { margin: 9px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.45; }

.send-error { margin-top: 20px; padding: 13px 14px; border: 1px solid var(--error); border-radius: var(--radius); color: var(--error); background: var(--error-ground); font-size: .9375rem; line-height: 1.45; }
.success p { margin: 13px 0 19px; color: var(--muted); line-height: 1.55; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 880px) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .main { padding-block: 38px 44px; }
  h1 { font-size: 2.7rem; }
}
@media (max-width: 540px) {
  .shell { width: calc(100% - 32px); }
  .masthead-inner { min-height: 60px; gap: 10px; }
  .brand { font-size: .9375rem; gap: 8px; }
  .brand img { width: 34px; height: 34px; }
  .home-link { font-size: .875rem; }
  .main { padding-block: 28px 36px; }
  h1 { font-size: 1.6875rem; }
  h2 { font-size: 1.4rem; }
  .workbench { gap: 13px; margin-top: 20px; }
  .wizard, .summary { padding: 21px 17px; }
  .wizard-progress { margin-bottom: 18px; }
  .fields { margin-top: 17px; }
  .actions { margin-top: 18px; }
  .button { padding-inline: 15px; }
  .actions .button-primary { flex: 1; }
  .result output { font-size: 1.95rem; }
}
