/* =============================================================================
 *  Layout & components. Colours/fonts come from brand.css — edit that to re-skin.
 * ============================================================================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--brand-font);
  color: var(--brand-ink);
  background: var(--brand-bg);
  line-height: 1.55;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.15rem 5rem;
}

/* ---- Header ------------------------------------------------------------- */
.masthead { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.75rem; }
.masthead .logo { height: 34px; width: auto; display: block; }
.masthead .wordmark { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }

.intro-card {
  background: var(--brand-card);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.6rem 1.7rem;
  margin-bottom: 1.5rem;
}
.intro-card h1 {
  margin: 0 0 0.7rem;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.intro-card #survey-intro p { margin: 0 0 0.85rem; color: var(--brand-muted); font-size: 0.98rem; }
.intro-card #survey-intro p:last-child { margin-bottom: 0; }

/* ---- Section headings --------------------------------------------------- */
.section-head {
  margin: 2.2rem 0 0.25rem;
  padding-left: 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-primary-dark);
}

/* ---- Question card ------------------------------------------------------ */
.q {
  background: var(--brand-card);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.4rem 1.4rem;
  margin-top: 1rem;
}
.q.invalid { border-color: var(--brand-danger); }
.q-title { font-weight: 600; font-size: 1.06rem; margin: 0 0 0.15rem; }
.q-title .req { color: var(--brand-action); margin-left: 0.15rem; }
.q-help { color: var(--brand-faint); font-size: 0.88rem; margin: 0.1rem 0 0.85rem; }
.q-error {
  display: none;
  color: var(--brand-danger);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.7rem;
}
.q.invalid .q-error { display: block; }

/* ---- Choice options (radio / checkbox as cards) ------------------------- */
.opts { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.9rem; }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--brand-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
  user-select: none;
}
.opt:hover { border-color: var(--brand-primary); }
.opt input { margin: 0.2rem 0 0; accent-color: var(--brand-primary); width: 1.05rem; height: 1.05rem; flex: none; }
.opt.checked { border-color: var(--brand-primary); background: var(--brand-primary-tint); }
.opt .opt-label { font-size: 0.98rem; }
.opt .other-box {
  display: none;
  margin-top: 0.55rem;
  width: 100%;
}
.opt.checked .other-box.show { display: block; }

/* ---- Scale (1..5) ------------------------------------------------------- */
.scale { margin-top: 0.9rem; }
.scale-row { display: flex; gap: 0.5rem; }
.scale-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.75rem 0.25rem;
  border: 1.5px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: var(--brand-card);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand-ink);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.scale-btn:hover { border-color: var(--brand-primary); }
.scale-btn.selected { border-color: var(--brand-primary); background: var(--brand-primary); color: #fff; }
.scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.55rem;
  color: var(--brand-faint);
  font-size: 0.82rem;
}
.scale-ends span:nth-child(2) { text-align: center; }
.scale-ends span:last-child { text-align: right; }

/* ---- Text inputs -------------------------------------------------------- */
input[type="text"], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--brand-ink);
  background: var(--brand-card);
  border: 1.5px solid var(--brand-line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  transition: border-color .12s ease;
}
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--brand-primary); }
textarea { min-height: 5.5rem; resize: vertical; margin-top: 0.9rem; }
.other-box input[type="text"] { font-size: 0.95rem; }

/* ---- Submit / actions --------------------------------------------------- */
.actions { margin-top: 1.8rem; }
.btn {
  appearance: none;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: var(--radius-pill);
  padding: 0.85rem 2.2rem;
  cursor: pointer;
  transition: background .12s ease, transform .05s ease;
}
.btn-primary { background: var(--brand-action); color: #fff; }
.btn-primary:hover { background: var(--brand-action-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.form-error {
  display: none;
  margin-top: 0.9rem;
  color: var(--brand-danger);
  font-size: 0.9rem;
  font-weight: 500;
}
.form-error.show { display: block; }

/* ---- Thank-you ---------------------------------------------------------- */
.thankyou {
  display: none;
  background: var(--brand-card);
  border: 1px solid var(--brand-line);
  border-top: 5px solid var(--brand-success);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.2rem 1.8rem;
  text-align: center;
}
.thankyou.show { display: block; }
.thankyou h2 { margin: 0 0 0.6rem; font-size: 1.4rem; }
.thankyou #thankyou-text p { margin: 0 0 0.6rem; color: var(--brand-muted); }
.thankyou #thankyou-text p:last-child { margin-bottom: 0; }
.thankyou .tick {
  width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--brand-success); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin-bottom: 0.9rem;
}

.hidden { display: none !important; }

/* ---- Mobile ------------------------------------------------------------- */
@media (max-width: 540px) {
  .wrap { padding: 1.4rem 0.95rem 4rem; }
  .intro-card h1 { font-size: 1.3rem; }
  .scale-btn { padding: 0.7rem 0.15rem; font-size: 0.98rem; }
  .scale-ends { font-size: 0.75rem; }
}
