/* ── Contact & assessment wizard ──────────────────────────────────
   Design tokens all come from main.css :root — this file must never
   invent its own (an undefined var() silently drops the declaration,
   which is how the progress bar and checkboxes ended up invisible). */

.page-contact { background: var(--bg-off); }

.pb-section { padding-bottom: var(--section-pad); }

.contact-page-container { max-width: 880px; }

.page-contact .section-header { margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem); }

/* ── Card ──────────────────────────────────────────────────────── */
.wizard-container {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* ── Progress ──────────────────────────────────────────────────── */
.wizard-progress[hidden] { display: none; } /* beats display:flex below */
.wizard-progress {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 20px clamp(1rem, 3vw, 2rem) 16px;
  background: var(--green-50);
  border-bottom: 1px solid var(--border);
  counter-reset: step;
}

.progress-step {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  transition: color var(--dur) var(--ease);
}

/* Connector rail — drawn between dots, never past the first or last */
.progress-step::before,
.progress-step::after {
  content: '';
  position: absolute;
  top: 15px;
  height: 2px;
  width: 50%;
  background: var(--green-100);
  transition: background var(--dur) var(--ease);
}
.progress-step::before { left: 0; }
.progress-step::after { right: 0; }
.progress-step:first-child::before,
.progress-step:last-child::after { display: none; }

.step-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--green-100);
  font-size: 13px; font-weight: 650;
  color: var(--muted);
  transition: all var(--dur) var(--ease);
}

.step-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Completed */
.progress-step.is-done { color: var(--green-700); cursor: pointer; }
.progress-step.is-done .step-dot { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.progress-step.is-done::before,
.progress-step.is-done::after { background: var(--green-600); }
.progress-step.is-done:hover .step-dot { transform: scale(1.08); }

/* Current */
.progress-step.is-active { color: var(--green-700); }
.progress-step.is-active .step-dot {
  border-color: var(--green-600); color: var(--green-700);
  box-shadow: 0 0 0 4px rgba(42, 77, 52, .12);
}
.progress-step.is-active::before { background: var(--green-600); }

/* A completed step is a real target — keep the keyboard on equal footing */
.progress-step.is-done:focus-visible {
  outline: 2.5px solid var(--green-600); outline-offset: 3px; border-radius: var(--radius-sm);
}

.wizard-progress-bar { height: 3px; background: var(--green-100); }
.wizard-progress-bar span {
  display: block; height: 100%; width: 20%;
  background: var(--orange-500);
  transition: width .4s var(--ease);
}

@media (max-width: 560px) {
  .wizard-progress { padding: 16px 10px 12px; }
  .step-label { display: none; }
  .progress-step::before, .progress-step::after { top: 15px; }
}

/* ── Steps ─────────────────────────────────────────────────────── */
.wizard-form { padding: clamp(1.5rem, 4vw, 2.75rem); }

.wizard-step { animation: wizardStepIn .35s var(--ease) both; }
.wizard-step[hidden] { display: none; }

@keyframes wizardStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wizard-step { animation: none; }
  .wizard-progress-bar span { transition: none; }
}

.step-count {
  margin: 0 0 6px;
  font-size: 11px; font-weight: 650; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--orange-600);
}

.wizard-step h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.2;
}

.step-intro {
  margin: 0 0 26px;
  font-size: 14.5px; line-height: 1.6; color: var(--text);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.field-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Invalid fields — a class, so clearing it cannot fight an inline style */
.form-group input.is-invalid,
.form-group select.is-invalid,
.form-group textarea.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3.5px rgba(179, 64, 30, .09);
}
.field-error { margin: 6px 0 0; font-size: 12.5px; font-weight: 550; color: var(--error); }

/* ── Number + unit ─────────────────────────────────────────────── */
.input-unit { position: relative; }
.input-unit input { padding-right: 52px; }
.input-unit .unit {
  position: absolute; top: 50%; right: 16px; transform: translateY(-50%);
  font-size: 14px; font-weight: 600; color: var(--muted); pointer-events: none;
}
/* The spinner arrows collide with the unit and are useless on a weight field */
.input-unit input::-webkit-outer-spin-button,
.input-unit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-unit input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ── Fieldset ──────────────────────────────────────────────────── */
.field-set { border: 0; padding: 0; margin: 0 0 17px; }
.field-set legend {
  padding: 0; margin-bottom: 12px;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
}

/* ── Selectable tiles ──────────────────────────────────────────── */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.check-tile { position: relative; margin: 0; }
.check-tile input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer;
}
.check-tile span {
  display: flex; align-items: center; gap: 11px;
  min-height: 52px; padding: 11px 15px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px; font-weight: 550; color: var(--text); line-height: 1.35;
  transition: all var(--dur) var(--ease);
}
/* The box is drawn, not native — native checkboxes cannot be recoloured reliably */
.check-tile span::before {
  content: '';
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border: 1.5px solid var(--green-200); border-radius: 6px;
  background: #fff center / 13px no-repeat;
  transition: all var(--dur) var(--ease);
}
.check-tile input:hover + span { border-color: var(--green-500); }
.check-tile input:checked + span {
  border-color: var(--green-600); background: var(--green-50); color: var(--green-800);
}
.check-tile input:checked + span::before {
  background-color: var(--green-600); border-color: var(--green-600);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.check-tile input:focus-visible + span {
  outline: 2.5px solid var(--green-600); outline-offset: 2px;
}

/* ── Review summary ────────────────────────────────────────────── */
.review {
  margin: 28px 0 22px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-off);
  overflow: hidden;
}
.review-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); background: #fff; }
.review-head h4 {
  margin: 0 0 4px; font-family: var(--font-display); font-size: 17px; font-weight: 500; color: var(--ink);
}
.review-head p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.review-section { padding: 16px 20px; }
.review-section + .review-section { border-top: 1px solid var(--border); }
.review-section h5 {
  margin: 0 0 10px;
  font-size: 11px; font-weight: 650; letter-spacing: 1.5px; text-transform: uppercase; color: var(--green-600);
}
.review-row {
  display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 16px;
  padding: 5px 0; font-size: 13.5px; line-height: 1.5;
}
.review-row dt { color: var(--muted); font-weight: 550; }
/* pre-line, so a textarea answer keeps the line breaks the visitor typed —
   textContent alone would collapse them into one run-on line. */
.review-row dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.review-empty { margin: 0; font-size: 13.5px; color: var(--muted); font-style: italic; }

@media (max-width: 520px) {
  .review-row { grid-template-columns: 1fr; gap: 2px; padding: 7px 0; }
}

/* ── Consent ───────────────────────────────────────────────────── */
.consent-box {
  margin: 22px 0;
  padding: 18px 20px;
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  background: var(--green-50);
  transition: border-color var(--dur) var(--ease);
}
.consent-box.is-invalid { border-color: var(--error); background: #FBEDE7; }

.consent-label {
  display: grid; grid-template-columns: auto 1fr; gap: 13px;
  align-items: start; cursor: pointer; margin: 0;
}
.consent-label input {
  appearance: none; -webkit-appearance: none;
  width: 21px; height: 21px; margin: 2px 0 0;
  border: 1.5px solid var(--green-200); border-radius: 6px;
  background: #fff center / 13px no-repeat;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.consent-label input:checked {
  background-color: var(--green-600); border-color: var(--green-600);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.consent-label input:focus-visible { outline: 2.5px solid var(--green-600); outline-offset: 2px; }
.consent-label > span { font-size: 13px; line-height: 1.6; color: var(--text); }
.consent-label strong { display: block; margin-bottom: 3px; font-weight: 650; color: var(--ink); }
.consent-label a { color: var(--green-600); font-weight: 600; text-decoration: underline; }
/* main.css only colours .req inside a .form-group label */
.consent-label .req { color: var(--orange-600); }

/* ── Controls ──────────────────────────────────────────────────── */
.wizard-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 30px; padding-top: 22px;
  border-top: 1px solid var(--border);
}
.wizard-controls-spacer { flex: 1 1 auto; }

/* The UA's [hidden] rule loses to any author `display`, and .btn sets
   inline-flex — without this, hiding a control does nothing at all. */
.wizard-controls .btn[hidden] { display: none; }

@media (max-width: 480px) {
  .wizard-controls { flex-direction: column-reverse; align-items: stretch; }
  .wizard-controls .btn { width: 100%; }
  .wizard-controls-spacer { display: none; }
}

/* ── Success ───────────────────────────────────────────────────── */
.wizard-done { padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 4vw, 3rem); text-align: center; }
.wizard-done[hidden] { display: none; }
.done-mark {
  width: 62px; height: 62px; margin: 0 auto 20px;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--green-50); color: var(--green-600);
  border: 2px solid var(--green-100);
}
.done-mark svg { width: 28px; height: 28px; }
.wizard-done h3 {
  margin: 0 0 10px; font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 500; color: var(--ink);
}
.wizard-done p {
  max-width: 46ch; margin: 0 auto 26px;
  font-size: 15px; line-height: 1.65; color: var(--text);
}

/* The wizard feedback sits below the controls, so centre it like the buttons */
.wizard-form .form-feedback { margin-top: 18px; }
