/* ==========================================================================
   STOONE — interactive offer (/offer)
   Dark side rail with simple step cards and a light content sheet
   with calm, airy form UI. Same palette and fonts as the hero (main.css).

   Type scale (keep it short):  12 · 14 · 15 · 17 · 20 · 30   (+ rail figure 56)
   Spacing scale:               4 · 8 · 12 · 16 · 24 · 32 · 48 · 64
   ========================================================================== */

:root {
  /* STOONE styleguide (stoone–presentation.pen › Styleguide + light tone) */
  /* dark rail */
  --c-bg: #151519;              /* bg */
  --c-ink: #f8f6ef;             /* paper */
  --c-text: #d2d5c5;            /* sand */
  --c-muted: #d2d5c599;         /* text-muted */
  --c-faint: #d2d5c566;         /* outline-40 */
  --c-line: #d2d5c524;          /* hairline */
  --c-brick: #8e3c39;           /* brick: primary button, selected, fills — never text */
  --c-brick-hover: #7a3331;     /* brick, one step darker */
  --c-brick-pressed: #682b29;
  --c-surface-warm: #3d1817;    /* surface-warm, sparingly */
  --c-cta: #ca9377;             /* cta: primary action only */
  --c-cta-pressed: #a26d55;

  /* light sheet — the styleguide's light tone */
  --s-bg: #f8f6ef;              /* paper */
  --s-card: #fffaf6;            /* btn-fg (light), card / field surface */
  --s-ink: #1c1a18;             /* ink / fg */
  --s-text: #3a3632;            /* ink-80 */
  --s-muted: #6b655e;           /* muted / fg-muted */
  --s-faint: #9a938a;
  --s-line: #e2dbd1;            /* line / fg-line */
  --s-line-strong: #cfc6ba;
  --s-hover: #eae5de;           /* comfort-40 */
  --s-sel: #8e3c39;             /* brick = selected */
  --s-sel-bg: #8e3c390d;

  --font-display: "Lexend", system-ui, sans-serif;
  --font-text: "Hanken Grotesk", system-ui, sans-serif;

  --rail-w: clamp(300px, 28vw, 400px);
  --r-sm: 4px;                  /* radius-sm: chips, cards, thumbnails */
  --r-pill: 999px;              /* radius-pill: controls */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--c-bg-deep);
  color: var(--s-text);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

svg {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--s-ink);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--c-ink);
  color: var(--c-bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

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

/* ---------- App shell ----------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
}

/* ---------- Rail (dark) --------------------------------------------------- */

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  color: var(--c-text);
  background: var(--c-bg);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--c-line) transparent;
}

.rail__inner {
  display: flex;
  flex-direction: column;
  gap: 48px;
  min-height: 100%;
  padding: 40px 32px 32px;
}

.rail__brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: fit-content;
  color: var(--c-ink);
  text-decoration: none;
  border-radius: 4px;
}

.rail__brand svg {
  width: 112px;
  height: 19px;
  fill: currentColor;
}

.rail__brand span {
  color: var(--c-muted);
  font-size: 14px;
}

.rail__toggle {
  display: none;
}

/* Step cards */
.steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 64px;
  padding: 14px 16px 14px 20px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--c-text);
  text-align: left;
  font-size: 15px;
  line-height: 1.35;
  transition: border-color 0.2s, background-color 0.2s;
}

button.step {
  cursor: pointer;
}

button.step:hover {
  border-color: var(--c-faint);
  background: #d2d5c50f;
}

.step__name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.step__name small {
  color: var(--c-faint);
  font-size: 13px;
}

.step.is-current {
  border-color: var(--c-brick);
  background: var(--c-surface-warm);
  color: var(--c-ink);
  font-weight: 500;
}

.step.is-done {
  color: var(--c-text);
}

.step.is-soon {
  min-height: 0;
  padding-block: 12px;
  border-color: transparent;
  background: none;
  color: var(--c-faint);
}

/* status marks */
.mark {
  flex: none;
  width: 28px;
  height: 28px;
}

.mark--done {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-text);
  color: var(--c-bg);
}

.mark--done svg {
  width: 14px;
  height: 14px;
}

.mark--ring circle {
  fill: none;
  stroke-width: 2.5;
}

.mark--ring .track {
  stroke: #d2d5c526;
}

.mark--ring .fill {
  stroke: var(--c-text);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dasharray 0.5s var(--ease);
}

.rail__foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
}

.rail__back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--c-text);
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: #d2d5c540;
  text-underline-offset: 4px;
}

.rail__back:hover {
  color: var(--c-ink);
}

.rail__back svg {
  width: 20px;
  height: 20px;
}

.rail__tools {
  display: flex;
  gap: 16px;
}

.rail__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-faint);
  font-size: 13px;
  cursor: pointer;
}

.rail__link:hover {
  color: var(--c-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Sheet (light) ------------------------------------------------- */

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 12px 12px 12px 0;
  border-radius: var(--r-sm);
  background: var(--s-bg);
  color: var(--s-text);
  overflow: clip;
}

.sheet__bar {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 3px;
  background: var(--s-line);
}

.sheet__bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--s-sel);   /* brick fill */
  transition: width 0.6s var(--ease);
}

.sheet__form {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sheet__head,
.sheet__body {
  width: min(calc(100% - 64px), 600px);
  margin-inline: auto;
}

.sheet__head {
  padding-top: clamp(48px, 9vh, 96px);
  padding-bottom: 32px;
  border-bottom: 1px solid var(--s-line);
}

.sheet__eyebrow {
  color: var(--s-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;     /* label: 12 · +0.72 */
  text-transform: uppercase;
}

.sheet__title {
  margin-top: 12px;
  color: var(--s-ink);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;             /* styleguide section title: 28 / 1.1 · −0.5 */
  line-height: 1.1;
  letter-spacing: -0.018em;
  text-wrap: balance;
  outline: none;
}

.sheet__lead {
  margin-top: 8px;
  max-width: 52ch;
  color: var(--s-muted);
  font-size: 15px;
}

.sheet__body {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding-top: 40px;
  padding-bottom: 80px;
}

/* entrance */
.sheet__form.is-entering .sheet__head,
.sheet__form.is-entering .sheet__body {
  animation: rise 0.45s var(--ease) both;
}

.sheet__form.is-entering .sheet__body {
  animation-delay: 0.05s;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Sections ------------------------------------------------------ */

.sec {
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-margin-top: 40px;
}

.sec__head h2 {
  color: var(--s-ink);
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.45;
}

.sec__head p {
  margin-top: 4px;
  color: var(--s-muted);
  font-size: 14px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Choice cards -------------------------------------------------- */

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.choices--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 48px 16px 16px;
  border: 1px solid var(--s-line);
  border-radius: var(--r-sm);
  background: var(--s-card);
  color: var(--s-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.choice:hover {
  border-color: var(--s-line-strong);
  background: var(--s-hover);
}

.choice__icon {
  width: 20px;
  height: 20px;
  margin-bottom: 12px;
  color: var(--s-faint);
  transition: color 0.15s;
}

.choice b {
  color: var(--s-ink);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
}

.choice span {
  color: var(--s-muted);
  font-size: 14px;
  line-height: 1.45;
}

/* radio / checkbox mark */
.choice::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 16px;
  height: 16px;
  border: 1px solid var(--s-line-strong);
  border-radius: 50%;
  background: var(--s-card);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.choice--multi::after {
  border-radius: 4px;
}

.choice[aria-checked="true"] {
  border-color: var(--s-sel);
  background: var(--s-sel-bg);
}

.choice[aria-checked="true"] .choice__icon {
  color: var(--s-sel);
}

.choice[aria-checked="true"]::after {
  border-color: var(--s-sel);
  background: var(--s-sel);
  box-shadow: inset 0 0 0 3px var(--s-card);
}

.choice--multi[aria-checked="true"]::after {
  box-shadow: none;
  background: var(--s-sel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- Fields -------------------------------------------------------- */

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 16px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field > label {
  color: var(--s-ink);
  font-size: 14px;
  font-weight: 500;
}

.control {
  position: relative;
  display: flex;
  align-items: center;
}

.control__suffix {
  position: absolute;
  right: 20px;
  color: var(--s-faint);
  font-size: 14px;
  pointer-events: none;
}

.input {
  width: 100%;
  height: 48px;                /* control-h */
  padding: 0 20px;
  border: 1px solid var(--s-line);
  border-radius: var(--r-pill);
  background: var(--s-card);
  color: var(--s-ink);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input.has-suffix {
  padding-right: 76px;
}

.input::placeholder {
  color: var(--s-faint);
  opacity: 1;
}

.input:hover {
  border-color: var(--s-line-strong);
}

.input:focus {
  border-color: var(--s-ink);
}

.input:disabled {
  background: var(--s-hover);
  color: var(--s-faint);
  cursor: not-allowed;
}

.input[type="number"] {
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

textarea.input {
  height: auto;
  min-height: 128px;
  padding: 14px 20px;
  border-radius: 24px;
  line-height: 1.55;
  resize: vertical;
}

.sublabel {
  color: var(--s-muted);
  font-size: 14px;
}

.hint {
  color: var(--s-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.hint b {
  color: var(--s-ink);
  font-weight: 600;
}

.hint.is-warn {
  color: var(--s-ink);
}

.hint.is-warn::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--s-sel);
  vertical-align: 2px;
}

.hint:empty {
  display: none;
}

/* conditional follow-up */
.reveal {
  padding: 16px;
  border: 1px solid var(--s-line);
  border-radius: var(--r-sm);
  background: var(--s-card);
  animation: rise 0.3s var(--ease) both;
}

/* ---------- Toggle row ---------------------------------------------------- */

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--s-line);
  border-radius: var(--r-sm);
  background: var(--s-card);
  cursor: pointer;
}

.toggle b {
  display: block;
  color: var(--s-ink);
  font-weight: 500;
  font-size: 15px;
}

.toggle small {
  color: var(--s-muted);
  font-size: 14px;
}

.switch {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--s-line-strong);
  transition: background-color 0.2s;
  pointer-events: none;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--s-card);
  box-shadow: 0 1px 3px #15151940;
  transition: transform 0.2s var(--ease);
}

.switch input:checked + span {
  background: var(--s-sel);
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.switch input:focus-visible + span {
  outline: 2px solid var(--s-sel);
  outline-offset: 2px;
}

/* ---------- Footer nav ---------------------------------------------------- */

.sheet__nav {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding: 16px 32px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--s-line);
  background: #f8f6efee;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.sheet__nav > :first-child {
  justify-self: start;
}

.sheet__nav > :last-child {
  justify-self: end;
}

.nav__info {
  color: var(--s-muted);
  font-size: 14px;
  white-space: nowrap;
}

.nav__info b {
  color: var(--s-ink);
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;                /* control-h-sm */
  padding: 0 20px;
  border: 1px solid var(--s-line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--s-ink);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}

.btn:hover {
  background: var(--s-hover);
  border-color: var(--s-muted);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  min-width: 148px;
  height: 48px;
  padding: 0 32px;
  border-color: var(--c-brick);
  background: var(--c-brick);   /* primary: brick fill, paper label */
  color: var(--c-ink);
  font-size: 16px;
  font-weight: 700;
}

.btn--primary:hover {
  border-color: var(--c-brick-hover);
  background: var(--c-brick-hover);
}

.btn--primary:active {
  border-color: var(--c-brick-pressed);
  background: var(--c-brick-pressed);
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ---------- Summary ------------------------------------------------------- */

.sum {
  border: 1px solid var(--s-line);
  border-radius: var(--r-sm);
  background: var(--s-card);
  overflow: hidden;
}

.sum__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--s-line);
  background: var(--s-bg);
}

.sum__head h2 {
  color: var(--s-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-family: var(--font-text);
  font-size: 15px;
}

.sum dl {
  display: grid;
  grid-template-columns: minmax(130px, 190px) 1fr;
  margin: 0;
  padding: 4px 20px;
  font-size: 15px;
}

.sum dt,
.sum dd {
  padding: 12px 0;
  border-bottom: 1px solid var(--s-line);
}

.sum dt:last-of-type,
.sum dd:last-of-type {
  border-bottom: 0;
}

.sum dt {
  color: var(--s-muted);
}

.sum dd {
  margin: 0;
  color: var(--s-ink);
  overflow-wrap: anywhere;
}

.sum .empty {
  color: var(--s-faint);
}

.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--s-ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--s-line-strong);
  text-underline-offset: 3px;
  cursor: pointer;
}

.linkbtn:hover {
  text-decoration-color: currentColor;
}

.next {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--s-line);
}

.next li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--s-line);
  color: var(--s-muted);
  font-size: 14px;
}

.next b {
  color: var(--s-ink);
  font-weight: 500;
  font-size: 15px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .app {
    grid-template-columns: 1fr;
  }

  /* rail collapses into a compact dark header with an expandable step list */
  .rail {
    position: relative;
    height: auto;
    overflow: visible;
  }

  .rail__inner {
    gap: 20px;
    padding: 20px 20px 32px;
  }

  .rail__brand {
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
  }

  .rail__brand svg {
    width: 92px;
    height: 16px;
  }

  .rail__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--c-brick);
    border-radius: var(--r-sm);
    background: var(--c-surface-warm);
    color: var(--c-ink);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
  }

  .rail__toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
  }

  .rail__toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }

  .steps,
  .rail__foot {
    display: none;
  }

  .rail.is-open .steps,
  .rail.is-open .rail__foot {
    display: flex;
  }

  .sheet {
    margin: -12px 0 0;
    border-radius: 20px 20px 0 0;
  }

  .sheet__head,
  .sheet__body {
    width: calc(100% - 40px);
  }

  .sheet__head {
    padding-top: 36px;
    padding-bottom: 24px;
  }

  .sheet__title {
    font-size: 26px;
  }

  .sheet__body {
    gap: 48px;
    padding-top: 32px;
    padding-bottom: 56px;
  }

  .sheet__nav {
    padding-inline: 20px;
  }
}

@media (max-width: 560px) {
  .row,
  .choices,
  .choices--2 {
    grid-template-columns: 1fr;
  }

  .row--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* compact cards on phones: icon + title on one line */
  .choice {
    display: grid;
    grid-template-columns: 20px 1fr;
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
  }

  .choice__icon {
    margin-bottom: 0;
  }

  .choice span {
    grid-column: 2;
  }

  .sheet__nav {
    grid-template-columns: auto 1fr;
  }

  .nav__info {
    display: none;
  }

  .sheet__nav .btn--primary {
    justify-self: stretch;
  }

  .sum dl {
    grid-template-columns: 1fr;
  }

  .sum dt {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .next li {
    flex-direction: column;
    gap: 2px;
  }
}

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

@media (forced-colors: active) {
  .choice[aria-checked="true"] {
    outline: 3px solid Highlight;
  }
  .step.is-current {
    outline: 2px solid Highlight;
  }
}
