/* =====================================================================
   P01 Nutrition Engine - web form - styles.css v1.0 (2026-11-09)
   Component C2 of the 26Q4 Web Form Build.
   The look of the form. Brand colours are set by form.js from
   instance-config.json (--brand, --accent, --bg, --text); the values
   below are only fallbacks. System fonts only: nothing loads from
   Google Fonts or anyone else.
   ===================================================================== */

:root {
  --brand: #1f5c7a;
  --accent: #e3a33b;
  --bg: #f4f7f8;
  --text: #1e2a30;
  --muted: #55636b;
  --card: #ffffff;
  --line: #d5dde1;
  --error: #b3261e;
  --error-bg: #fdecea;
  --focus: #1a73e8;
  --radius: 10px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--text);
  padding: 8px 12px;
  z-index: 10;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Header and footer */

.site-header {
  background: var(--brand);
  color: #fff;
  border-bottom: 4px solid var(--accent);
}
.site-header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 14px;
}
.brand-name {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
}
.brand-logo { display: block; max-height: 56px; max-width: 100%; }
.brand-sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.9;
}

.site-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 40px;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-footer a { color: inherit; }

/* Layout */

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  outline: none;
}
.loading { color: var(--muted); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 16px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
@media (min-width: 600px) {
  .card { padding: 28px 32px 32px; }
}

.progress-label {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
}
.progress {
  display: block;
  width: 100%;
  height: 8px;
  margin: 0 0 16px;
  border: 0;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
}
.progress::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
.progress::-webkit-progress-value { background: var(--brand); border-radius: 4px; }
.progress::-moz-progress-bar { background: var(--brand); border-radius: 4px; }

.step-title {
  margin: 0 0 12px;
  font-size: 1.4rem;
  line-height: 1.25;
  color: var(--brand);
  outline: none;
}
.step-body p, .screen p { margin: 0 0 12px; }
.step-body ul, .screen ul { margin: 0 0 14px; padding-left: 1.3em; }
.step-body li { margin-bottom: 4px; }

.help { color: var(--muted); font-size: 0.95rem; }
.help p { margin: 0 0 8px; }
#step-help { margin-bottom: 8px; }

.privacy-notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 14px 6px;
  margin: 0 0 18px;
  font-size: 0.95rem;
}
.privacy-notice h3 {
  font-size: 1rem;
  margin: 14px 0 6px;
  color: var(--brand);
}

/* Questions */

.field {
  margin: 0 0 22px;
  padding-top: 4px;
}
.field[hidden], .other-box[hidden], .converter[hidden], .error[hidden], .error-summary[hidden] { display: none; }

.q {
  display: block;
  font-weight: 600;
  margin: 0 0 6px;
  padding: 0;
}
.req { font-weight: 400; color: var(--muted); font-size: 0.9rem; }

fieldset.group { border: 0; margin: 0; padding: 0; min-width: 0; }

input[type="text"], input[type="email"], textarea {
  display: block;
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1.5px solid #9aa7ad;
  border-radius: 8px;
  padding: 10px 12px;
}
textarea { resize: vertical; min-height: 110px; }

.number-row { display: flex; align-items: center; gap: 10px; }
.number-row input { max-width: 11em; }
.unit { color: var(--muted); }

input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.options { display: grid; gap: 8px; }
.option, .tick-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.option:has(input:checked), .tick-row:has(input:checked) {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 7%, #fff);
}
.option input, .tick-row input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}
.option label, .tick-row label { flex: 1 1 auto; cursor: pointer; }
.field-tick { margin-bottom: 12px; }

.scale-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
@media (min-width: 520px) {
  .scale-row { grid-template-columns: repeat(10, 1fr); }
}
.scale-row .option {
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  text-align: center;
}
.scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.other-box { margin-top: 10px; }
.other-box label { display: block; font-size: 0.95rem; margin-bottom: 4px; }

.converter-wrap { margin-top: 6px; }
.link-btn {
  background: none;
  border: 0;
  padding: 4px 0;
  font: inherit;
  font-size: 0.95rem;
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
}
.converter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.converter label { width: 100%; font-size: 0.9rem; margin-bottom: -4px; }
.converter input { max-width: 7em; }
.conv-note { width: 100%; margin: 0; font-size: 0.9rem; color: var(--muted); }

/* Errors */

.error {
  color: var(--error);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 6px 0 0;
}
.has-error input[type="text"], .has-error input[type="email"], .has-error textarea { border-color: var(--error); }
.has-error .option, .has-error .tick-row { border-color: var(--error); }

.error-summary {
  border: 2px solid var(--error);
  background: var(--error-bg);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 18px;
}
.error-summary-title { margin: 0 0 4px; font-weight: 700; color: var(--error); }
.error-summary ul { margin: 0; padding-left: 1.2em; }
.error-summary a { color: var(--error); }

/* Buttons */

.nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}
.nav .btn-primary:only-child { margin-left: auto; }

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  padding: 12px 22px;
  min-height: 48px;
  cursor: pointer;
  border: 2px solid var(--brand);
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-secondary { background: #fff; color: var(--brand); }
.btn-small { padding: 6px 14px; min-height: 40px; font-size: 0.95rem; background: #fff; color: var(--brand); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Send step */

.send-area { margin-top: 8px; }
.send-note { font-size: 0.95rem; color: var(--muted); }
.turnstile-box { min-height: 70px; margin: 10px 0; }
.send-status { min-height: 1.5em; font-weight: 600; }
