:root {
  --form-primary: #1d4d4f;
  --form-primary-dark: #12393b;
  --form-accent: #da7255;
  --form-accent-soft: #fff0eb;
  --form-return: #dff3e3;
  --form-return-border: #9dceaa;
  --form-return-text: #28613d;
  --form-text: #17292c;
  --form-muted: #617477;
  --form-border: #d9e2e2;
  --form-surface: #ffffff;
  --form-subtle: #f4f8f8;
  --form-danger: #b42318;
  --form-radius: 16px;
  --form-space: 1.5rem;
  --form-max-width: 1060px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: #edf3f2; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--form-text);
  background: radial-gradient(circle at top left, #f8fbfa 0, #edf3f2 45%, #e5eeee 100%);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell { width: min(calc(100% - 2rem), var(--form-max-width)); margin: clamp(2rem, 6vw, 5rem) auto; }
.shell > header { max-width: 720px; margin: 0 auto 2.5rem; text-align: center; }
.eyebrow { margin: 0 0 .55rem; color: var(--form-primary); font-size: .78rem; font-weight: 800; letter-spacing: .14em; }
.shell h1 { max-width: 700px; margin: 0 auto; font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.1; letter-spacing: -.035em; }
.subtitle { margin: 1rem auto 0; color: var(--form-muted); font-size: 1.05rem; }

.progress {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .55rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.progress li { min-height: 4.45rem; padding: .55rem .3rem; color: #718487; border: 1px solid var(--form-border); border-radius: 12px; background: #f9fbfb; font-size: .68rem; font-weight: 650; line-height: 1.2; text-align: center; transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease; }
.progress__number { display: grid; width: 1.65rem; height: 1.65rem; margin: 0 auto .16rem; place-items: center; border-radius: 50%; color: #587073; background: #e3eceb; font-size: .75rem; font-weight: 800; }
.progress__icon { display: block; margin-bottom: .1rem; font-size: 1rem; line-height: 1; }
.progress__label { display: block; }
.progress .is-active { color: var(--form-primary); border-color: var(--form-primary); background: var(--form-surface); box-shadow: 0 7px 16px #1d4d4f13; transform: translateY(-2px); }
.progress .is-active .progress__number { color: white; background: var(--form-primary); }

form, .notice {
  border: 1px solid #dfe8e7;
  border-radius: calc(var(--form-radius) + 4px);
  background: var(--form-surface);
  box-shadow: 0 20px 60px #153f4114;
}
form { overflow: hidden; padding: clamp(1.35rem, 4vw, 3.25rem); }
.step { animation: step-enter .34s cubic-bezier(.2,.75,.25,1) both; }
.step__heading { max-width: 720px; margin: 0 0 2rem; }
.step__heading p:first-child { margin: 0 0 .25rem; color: var(--form-accent); font-size: .86rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.step h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.35rem); line-height: 1.18; letter-spacing: -.025em; }
.step__icon { display: inline-block; margin-right: .4rem; font-size: .88em; vertical-align: -.04em; }
.step__heading p:last-child { margin: .75rem 0 0; color: var(--form-muted); }

.section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.35rem;
  margin-top: 1.5rem;
  padding: 1.65rem;
  border: 1px solid #e1e9e8;
  border-radius: var(--form-radius);
  background: linear-gradient(145deg, #fff 0, #fcfdfd 100%);
}
.section > h3, .section > .help { grid-column: 1 / -1; }
.section h3 { margin: 0 0 .45rem; padding-bottom: .7rem; border-bottom: 1px solid #dce8e6; color: var(--form-primary); font-size: 1.18rem; line-height: 1.3; }
.section__help { margin: .4rem 0 1.25rem; padding: .85rem 1rem; border-left: 4px solid var(--form-accent); border-radius: 0 10px 10px 0; color: #465e60; background: var(--form-accent-soft); }

.section > .field { padding-top: 1.1rem; border-top: 1px solid #e5edec; }
.field { min-width: 0; margin: 0 0 1.35rem; }
.section > .field:nth-last-child(-n + 2) { margin-bottom: 0; }
.field--radio, .field--checkbox_group, .field--textarea, .field--checkbox { grid-column: 1 / -1; }
.field > label:not(.choice), .field__legend { display: block; margin-bottom: .5rem; color: #223b3e; font-size: .96rem; font-weight: 760; line-height: 1.35; }
.field > label span[aria-hidden="true"] { color: var(--form-accent); }
.help { margin: -.15rem 0 .65rem; color: var(--form-muted); font-size: .88rem; line-height: 1.45; }

.field input:not([type="radio"]):not([type="checkbox"]), .field select, .field textarea {
  width: 100%;
  min-height: 3.25rem;
  padding: .78rem .9rem;
  border: 1px solid #bdcdcc;
  border-radius: 10px;
  outline: none;
  color: var(--form-text);
  background: #fff;
  box-shadow: inset 0 1px 0 #ffffff;
  font: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #91aaa8; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--form-primary); box-shadow: 0 0 0 4px #1d4d4f1c; }
.field input:disabled, .field select:disabled, .field textarea:disabled { cursor: not-allowed; opacity: .55; }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .7rem; }
.choice { display: flex; min-height: 3.5rem; align-items: flex-start; gap: .7rem; padding: .85rem .95rem; border: 1px solid #c9d7d6; border-radius: 11px; color: #294144; background: #fff; cursor: pointer; line-height: 1.35; transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.choice:hover { border-color: #7ea29f; background: #f9fcfb; transform: translateY(-1px); }
.choice:has(input:checked) { border-color: var(--form-primary); background: #eaf4f2; box-shadow: 0 4px 12px #1d4d4f13; }
.choice input { flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin: .08rem 0 0; accent-color: var(--form-primary); }
.choice:has(input:focus-visible), .button:focus-visible, .link-button:focus-visible { outline: 3px solid #f4b5a5; outline-offset: 3px; }
.choice--consent { min-height: auto; margin: 0; padding: 1rem; border-color: #b8cdca; background: #f7fbfa; }

.error { margin: .55rem 0 0; padding: .6rem .75rem; border-left: 3px solid var(--form-danger); border-radius: 0 8px 8px 0; color: #8b1e15; background: #fff1ef; font-size: .9rem; font-weight: 650; }
.has-error input:not([type="radio"]):not([type="checkbox"]), .has-error select, .has-error textarea, .has-error .choices { border-color: var(--form-danger); }
.has-error .choice { border-color: #e4aaa3; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; margin-top: 2.2rem; padding-top: 1.5rem; border-top: 1px solid #e1e9e8; }
.actions [data-next], .actions button[type="submit"] { margin-left: auto; }
.button { display: inline-flex; min-height: 3.1rem; align-items: center; justify-content: center; gap: .6rem; padding: .78rem 1.2rem; border: 1px solid transparent; border-radius: 10px; color: #fff; background: var(--form-primary); box-shadow: 0 5px 12px #1d4d4f1c; font: inherit; font-weight: 780; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.button:hover { background: var(--form-primary-dark); box-shadow: 0 8px 18px #1d4d4f2b; transform: translateY(-1px); }
.button--quiet { border-color: #cfdddd; color: var(--form-primary); background: #f1f6f5; box-shadow: none; }
.button--quiet:hover { color: #fff; background: var(--form-primary); }
.button--return { border-color: var(--form-return-border); color: var(--form-return-text); background: var(--form-return); animation: return-nudge 2.6s ease-in-out infinite; }
.button--return:hover { color: #18492c; background: #c7e9cf; box-shadow: 0 8px 18px #28613d20; }
.button--return:focus-visible { outline-color: #79b989; }
.button__arrow { font-size: 1.25rem; line-height: 0; transition: transform .18s ease; }
.button--return:hover .button__arrow { transform: translateX(3px); }

.notice { margin-bottom: 1rem; padding: 1.25rem 1.4rem; }
.notice h2 { margin: 0 0 .5rem; color: var(--form-primary); }
.notice p { margin: 0; }
.notice--success { border-top: 5px solid var(--form-primary); }
.success-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 1.5rem; margin-top: 1.7rem; }
.success-actions__receipt { display: contents; }
.button--new-request { border-color: #c7d7d5; color: var(--form-primary); background: #f2f7f6; box-shadow: none; }
.button--new-request:hover { color: #fff; background: var(--form-primary); box-shadow: 0 8px 18px #1d4d4f24; }
.button--download { color: #fff; background: #2f7561; box-shadow: 0 5px 12px #2f756126; }
.button--download:hover { background: #1f5b4a; box-shadow: 0 8px 18px #1f5b4a30; }
.notice--error { border-color: #e5a199; color: #8b1e15; background: #fff8f7; }
.notice--info { margin: 1.5rem 0 0; border: 1px solid #bdd2cf; color: #315356; background: #f1f8f7; box-shadow: none; }
.honeypot { position: absolute; left: -9999px; }

.recap { margin-top: 1.7rem; padding: 1.6rem; border: 1px solid #cedddb; border-radius: var(--form-radius); background: #f5faf9; }
.recap > h3 { margin: 0 0 1rem; color: var(--form-primary); font-size: 1.3rem; }
.recap__block { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.25rem; margin-top: .75rem; padding: 1.15rem; border: 1px solid #d7e4e2; border-radius: 12px; background: #fff; }
.recap__block h4 { margin: 0; color: #254548; font-size: 1rem; }
.recap dl { display: grid; grid-template-columns: minmax(11rem, 1fr) minmax(0, 2fr); gap: .45rem 1rem; margin: .85rem 0 0; font-size: .91rem; }
.recap dt { color: var(--form-muted); font-weight: 650; }
.recap dd { min-width: 0; margin: 0; color: var(--form-text); overflow-wrap: anywhere; }
.link-button { flex: 0 0 auto; padding: .35rem .1rem; border: 0; border-bottom: 1px solid currentColor; color: var(--form-primary); background: transparent; font: inherit; font-weight: 760; cursor: pointer; }
.link-button:hover { color: var(--form-accent); }

.edit-return-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1.5rem; padding: .85rem 1rem; border: 1px solid var(--form-return-border); border-radius: 13px; color: var(--form-return-text); background: #f1faf2; animation: step-enter .3s ease both; }
.edit-return-banner p { margin: 0; font-size: .82rem; font-weight: 650; }
.actions--with-return { display: grid; grid-template-columns: 1fr auto 1fr; }
.actions--with-return [data-back] { justify-self: start; }
.actions--with-return .action-return { grid-column: 2; }
.actions--with-return [data-next], .actions--with-return button[type="submit"] { grid-column: 3; justify-self: end; margin-left: 0; }

@media (min-width: 821px) {
  .shell { margin-top: clamp(.8rem, 1.8vw, 1.5rem); }
  .shell > header { max-width: none; }
  .shell h1 { max-width: none; font-size: clamp(1.8rem, 2.65vw, 2.55rem); white-space: nowrap; }
  .progress { gap: .4rem; margin-bottom: 1.15rem; }
  .progress li { min-height: 3.75rem; padding: .38rem .25rem; font-size: .63rem; }
  .progress__number { width: 1.4rem; height: 1.4rem; margin-bottom: .1rem; font-size: .68rem; }
  .progress__icon { font-size: .82rem; }
}

@keyframes step-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes return-nudge { 0%, 72%, 100% { transform: translateX(0); } 82% { transform: translateX(4px); } 91% { transform: translateX(-1px); } }

@media (max-width: 820px) {
  .progress { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .progress li { min-height: 4.75rem; }
  .section { grid-template-columns: 1fr; padding: 1.2rem; }
  .field--radio, .field--checkbox_group, .field--textarea, .field--checkbox { grid-column: auto; }
}
@media (max-width: 580px) {
  .shell { width: min(calc(100% - 1rem), var(--form-max-width)); margin: 1.2rem auto 2rem; }
  .shell > header { margin-bottom: 1.5rem; }
  .progress { gap: .4rem; }
  .progress li { min-height: 4.35rem; padding: .5rem .2rem; font-size: .64rem; }
  .progress__number { width: 1.55rem; height: 1.55rem; margin-bottom: .1rem; }
  .progress__icon { font-size: .82rem; }
  form { padding: 1rem; }
  .step__heading { margin-bottom: 1.35rem; }
  .section { margin-top: 1rem; padding: 1rem; }
  .choices { grid-template-columns: 1fr; }
  .actions, .actions--with-return, .edit-return-banner, .recap__block { display: flex; align-items: stretch; flex-direction: column; }
  .actions--with-return .action-return { display: flex; justify-content: center; }
  .actions .button, .edit-return-banner .button { width: 100%; }
  .success-actions { align-items: stretch; flex-direction: column; }
  .success-actions .button { width: 100%; }
  .actions [data-next], .actions button[type="submit"] { margin-left: 0; }
  .recap { padding: 1rem; }
  .recap dl { grid-template-columns: 1fr; gap: .2rem; }
  .recap dd { margin-bottom: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
