/* ==========================================================================
   Application form — used twice (hero quick form + main form), one state
   ========================================================================== */

.appform {
  --field-bg: var(--c-field);
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* The hero card sits on a warmer background and is a touch more compact. */
.appform--hero {
  --field-bg: var(--c-field-hero);
  gap: 14px;
}

/* ---- Chrome: title, step counter, progress ---- */

.appform__chrome {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.appform__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.appform__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--c-ink);
}

.appform__count {
  font-size: 13px;
  color: var(--c-text-meta);
}

.progress {
  height: 4px;
  border-radius: var(--r-pill);
  background: #E5DFD4;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 33%;
  border-radius: var(--r-pill);
  background: var(--grad-cta);
  transition: width .25s ease;
}

/* ---- Back control ---- */

.backbtn {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--c-border-field);
  border-radius: 9px;
  background: var(--c-field);
  font-size: 14px;
  font-weight: 600;
  color: var(--c-ink);
  transition: all var(--t-base);
}

.backbtn .icon { --icon-size: 15px; --icon-stroke: 2.2; }

@media (hover: hover) {
  .backbtn:hover {
    background: var(--c-ink);
    border-color: var(--c-ink);
    color: #fff;
    transform: translateX(-3px);
  }
}

.appform--hero .backbtn {
  border-radius: var(--r-xs);
  background: #F1EEE8;
  font-size: 13.5px;
  padding: 9px 13px;
}

@media (hover: hover) {
  .appform--hero .backbtn:hover {
    background: #E7E2D8;
    border-color: var(--c-border-field);
    color: var(--c-ink);
    transform: none;
  }
}

/* ---- Steps ---- */

.step {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: omRise .35s ease-out both;
}

.step[hidden] { display: none; }

.step__title {
  font-size: clamp(19px, 18.3px + 0.19vw, 21px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--c-ink);
}

.step__title { text-wrap: balance; }

.step__desc {
  text-wrap: pretty;
  margin-top: -8px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--c-text-muted);
}

.step__hint {
  font-size: 12.5px;
  color: var(--c-red);
}

.step__hint:empty { display: none; }

/* ---- Level chips (real radio inputs) ---- */

/* Two across on desktop and tablet, stacked on phones — exactly what the
   export's `minmax(min(100%, 150px), 1fr)` resolves to (a 390px phone leaves
   278px inside the card, and two columns would need 310px).
   Never three across: that would orphan the fourth option.

   Container query rather than a media query, because the hero card and the
   main card are different widths at the same viewport. The 340px threshold
   keeps every phone up to 430px stacked. */
.levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@container (max-width: 340px) {
  .levels { grid-template-columns: minmax(0, 1fr); }
}

.level {
  position: relative;
  display: block;
  padding: 14px;
  border: 1px solid var(--c-border-field);
  border-radius: var(--r-sm);
  background: var(--field-bg);
  color: var(--c-ink);
  cursor: pointer;
  user-select: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast),
              background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.level input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.level__label {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.2;
}

.level--long .level__label { font-size: 15px; }

/* The design dimmed this with opacity .68, which lands at 3.7:1.
   An explicit colour hits the same look and passes AA. */
.level__desc {
  display: block;
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--c-text-muted);
}

@media (hover: hover) {
  .level:hover {
    background: var(--grad-cta);
    border-color: var(--c-red);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(218, 0, 15, .28);
  }
}

@media (hover: hover) {
  .level:hover .level__desc { color: rgba(255, 255, 255, .85); }
}

.level:has(input:checked) {
  background: var(--grad-cta);
  border-color: var(--c-red);
  color: #fff;
  font-weight: 600;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(218, 0, 15, .28);
}

.level:has(input:checked) .level__desc { color: rgba(255, 255, 255, .82); }

.level:has(input:focus-visible) {
  outline: 3px solid #FF6A3D;
  outline-offset: 3px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}

.field__req { color: var(--c-red); }

.input {
  width: 100%;
  padding: 15px 16px;
  background: var(--field-bg);
  border: 1px solid var(--c-border-field);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 15.5px;
  color: var(--c-ink);
}

.input::placeholder { color: #A8ADB1; }

.input[aria-invalid="true"] { border-color: var(--c-red); }

.formerror {
  padding: 13px 15px;
  background: var(--c-warm-4);
  border: 1px solid #F3C9CB;
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-red-deep);
}

.formerror[hidden] { display: none; }

.gdpr {
  font-size: 13px;
  line-height: 1.65;
  color: var(--c-text-meta);
}

.gdpr a { color: var(--c-red-deep); }

.appform__foot {
  text-wrap: pretty;
  margin-top: -2px;
  font-size: 14px;
  color: var(--c-text-meta);
}

/* The reassurance line belongs to the hero card only. */
.appform--main .appform__foot { display: none; }

/* ---- No-JS fallback: every step visible, native submit ---- */

.appform:not([data-enhanced]) .appform__chrome,
.appform:not([data-enhanced]) .backbtn,
.appform:not([data-enhanced]) [data-next] { display: none; }

.appform:not([data-enhanced]) .step { animation: none; }

/* ---- Success state ---- */

.sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 10px 0 4px;
  text-align: center;
  animation: omRise .4s ease-out both;
}

.sent[hidden] { display: none; }

.sent__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--grad-card);
  color: #fff;
  box-shadow: 0 14px 30px rgba(218, 0, 15, .28);
}

.sent__check .icon { --icon-size: 30px; --icon-stroke: 3; }

.sent__title {
  font-size: clamp(21px, 20.3px + 0.19vw, 24px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--c-ink);
}

.sent__lead {
  max-width: 420px;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-text-muted);
}

.sent__recap {
  width: 100%;
  max-width: 460px;
  padding: 6px 18px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  text-align: left;
}

.sent__recap li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--c-ink);
}

.sent__recap li + li { border-top: 1px solid #F2EDE5; }
.sent__recap .icon { --icon-size: 18px; color: var(--c-red); }
.sent__recap .flag { --flag-w: 18px; --flag-h: 13px; }

.sent__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  font-size: 13.5px;
  color: var(--c-text-meta);
}

.sent__foot a {
  color: var(--c-red-deep);
  font-weight: 600;
  text-decoration: none;
}

.sent__again {
  color: var(--c-text-meta);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 44px;
}
