/* Quotidian survey styles. Brand colors come from the approved design brief;
   the layout follows the reference survey (clarity.velarstrategies.com). */
:root {
  --blue: #0A66FF;          /* primary buttons, selected ratings, small labels */
  --blue-soft: #A9C6FF;     /* Next button before a rating is chosen */
  --blue-tint: #EEF4FF;
  --text: #45535A;          /* main text */
  --heading: #2B3A40;       /* headlines: a deeper shade of the main text color */
  --text-soft: #5E6C73;     /* supporting text (passes WCAG AA on white) */
  --border: #C5CED3;
  --orange: #FF5A00;        /* sparing accent: the panel's top edge */
  --panel: #FFFFFF;
  --bg: #F3F5F6;            /* light neutral background */
  --card: #F3F5F6;          /* rating explanation cards */
  --track: #E1E6E9;
  --error: #B42318;
  --error-tint: #FEF3F2;

  /* EB Garamond is an open-licensed web version of Garamond. */
  --font-heading: "EB Garamond", Garamond, "Garamond Premier Pro", "Adobe Garamond Pro", Georgia, "Times New Roman", serif;
  /* Helvetica Neue shows where the visitor's device has it (Apple devices). */
  --font-body: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

  --radius-panel: 20px;
  --radius-box: 12px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Page progress bar across the top (question screens only) */
.page-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.5rem clamp(1rem, 4vw, 2.5rem) 0;
  font-size: 0.875rem;
  color: var(--text-soft);
}
.page-progress .track { flex: 1; height: 4px; background: var(--track); border-radius: 2px; overflow: hidden; }
.page-progress .fill { display: block; height: 100%; background: var(--blue); border-radius: 2px; }
@media (prefers-reduced-motion: no-preference) { .page-progress .fill { transition: width 300ms ease-out; } }

.shell {
  max-width: 56rem;
  margin: 0 auto;
  padding: clamp(0.75rem, 2.5vh, 2rem) clamp(0.75rem, 4vw, 1.5rem) clamp(1rem, 3vh, 2rem);
}

/* Header */
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.25rem clamp(0.625rem, 2vh, 1.25rem);
}
.brand-logo { height: clamp(36px, 5vh, 44px); width: auto; max-width: 55%; display: block; }
.brand-wordmark { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 600; margin-right: auto; }
.brand-survey { font-size: 0.875rem; color: var(--text-soft); text-align: right; }

/* Panel */
.panel {
  background: var(--panel);
  border: 1px solid #E3E8EB;
  border-top: 5px solid var(--orange);
  border-radius: var(--radius-panel);
  padding: clamp(1.5rem, min(6vw, 5vh), 4rem) clamp(1.25rem, 5vw, 3.5rem) clamp(1.25rem, min(6vw, 3.5vh), 4rem);
  outline: none;
}

.label {
  margin: 0 0 clamp(0.625rem, 1.5vh, 1rem);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}

h1, h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--heading);
  margin: 0;
  text-wrap: balance;
  outline: none;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.5rem, 8vw, 4.25rem); line-height: 1.02; }
h2 { font-size: clamp(2rem, min(7vw, 5.75vh), 3.75rem); line-height: 1.05; }

.intro { margin-top: 1.75rem; }
.intro p { margin: 0 0 1.25rem; font-size: clamp(1.0625rem, 2.4vw, 1.25rem); line-height: 1.75; color: var(--text-soft); }
.meta { font-size: 0.9375rem; color: var(--text-soft); margin: 0.5rem 0 0; }

/* Fields */
.fields { display: grid; gap: 1.5rem; margin-top: 2.25rem; }
.field label { display: block; font-size: 0.9375rem; font-weight: 700; color: var(--heading); margin-bottom: 0.5rem; }
.field input {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.75rem 1.125rem;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
}
.field input::placeholder { color: #8C989E; }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field-error { margin: 0.5rem 0 0; font-size: 0.875rem; color: var(--error); }
.notice { font-size: 0.875rem; color: var(--text-soft); margin: 1.25rem 0 0; }

/* Buttons */
.actions { display: flex; gap: 0.75rem; margin-top: clamp(1.25rem, 3vh, 2.5rem); align-items: center; }
.actions .spacer { flex: 1; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 3.5rem;
  padding: 0.75rem 2rem;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn .arrow { font-weight: 400; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #0057E0; }
.btn-primary[aria-disabled="true"] { background: var(--blue-soft); cursor: default; }
.btn-secondary { background: #fff; color: var(--heading); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--text-soft); }
.btn[disabled] { cursor: progress; opacity: 0.75; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
h1:focus-visible, h2:focus-visible, .panel:focus-visible { outline: none; }

/* Question */
.descriptor { margin: clamp(0.625rem, 1.5vh, 1.25rem) 0 0; font-size: clamp(1.0625rem, min(2.4vw, 2.5vh), 1.3125rem); line-height: 1.6; color: var(--text-soft); }

.rating { border: 0; margin: clamp(1.25rem, 3vh, 2.75rem) 0 0; padding: 0; min-width: 0; }
.rating legend { font-size: 1rem; font-weight: 700; color: var(--heading); margin-bottom: clamp(0.625rem, 1.5vh, 1rem); padding: 0; }

/* The 1–5 choices, side by side */
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(0.5rem, 1.5vw, 1rem); }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.choice .box {
  display: grid;
  place-items: center;
  height: clamp(3.5rem, min(10vw, 8.5vh), 5.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  background: #fff;
  font-family: var(--font-body);
  font-size: clamp(1.5rem, min(4vw, 4.25vh), 2.125rem);
  font-weight: 500;
  color: var(--heading);
}
.choice:hover .box { border-color: var(--text-soft); }
.choice input:checked + .box { background: var(--blue); border-color: var(--blue); color: #fff; }
.choice input:focus-visible + .box { outline: 3px solid var(--blue); outline-offset: 3px; }
.choice input:disabled + .box { cursor: progress; }

/* Explanations for the labeled points (1, 3 and 5) */
.anchors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(0.75rem, 2vw, 1.5rem); margin-top: clamp(0.75rem, 2.25vh, 1.75rem); }
.anchor-card { background: var(--card); border-radius: var(--radius-box); padding: clamp(0.875rem, 2vh, 1.25rem) 1.125rem clamp(1rem, 2.25vh, 1.5rem); }
.anchor-card .n { display: block; font-size: clamp(1.375rem, 3vh, 1.75rem); line-height: 1; color: var(--blue); margin-bottom: clamp(0.5rem, 1.25vh, 0.875rem); }
.anchor-card p { margin: 0; font-size: clamp(0.875rem, 1.9vh, 0.9375rem); line-height: 1.5; color: var(--text-soft); }
.anchor-card.selected { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-tint); }

/* Alerts */
.alert {
  margin-top: 1.5rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-box);
  background: var(--error-tint);
  border: 1px solid #F4C7C3;
  color: var(--error);
  font-size: 0.9375rem;
}
.alert p { margin: 0; }
.alert p + p { margin-top: 0.375rem; }
.alert strong { font-weight: 700; }
.saving-status { margin: 0.5rem 0 0; min-height: 1.5em; font-size: 0.9375rem; color: var(--text-soft); text-align: right; }

/* Results */
.overall {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 2rem 0 0;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid #E3E8EB;
}
.overall .big {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(4.5rem, 16vw, 6.5rem);
  line-height: 0.9;
  color: var(--heading);
  font-variant-numeric: lining-nums;
}
.overall .caption { font-size: 1rem; color: var(--text-soft); }
.snapshot { margin: 1.75rem 0 0; font-size: clamp(1.0625rem, 2.4vw, 1.25rem); line-height: 1.7; color: var(--text-soft); }
.scores { list-style: none; margin: 2.25rem 0 0; padding: 0; display: grid; gap: 1.125rem; }
.scores li { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem; align-items: baseline; }
.scores .name { font-size: 1.0625rem; color: var(--heading); }
.scores .value { font-size: 1.25rem; font-weight: 700; color: var(--blue); line-height: 1; }
.scores .bar { grid-column: 1 / -1; height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.scores .bar span { display: block; width: 0; height: 100%; background: var(--blue); border-radius: 4px; }
@media (prefers-reduced-motion: no-preference) { .scores .bar span { transition: width 600ms ease-out; } }

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

@media (max-width: 40rem) {
  .anchors { grid-template-columns: 1fr; gap: 0.625rem; }
  .anchor-card { display: grid; grid-template-columns: 2rem 1fr; gap: 0.75rem; align-items: baseline; padding: 1rem; }
  .anchor-card .n { margin: 0; font-size: 1.375rem; }
}
@media (max-width: 30rem) {
  body { font-size: 1rem; }
  .brand-survey { display: none; }
  .actions .btn { flex: 1; padding: 0.75rem 1rem; }
  .actions .spacer { display: none; }
}
.page-progress .fill { width: 0; }
.actions-tight { margin-top: 0.75rem; }
