:root {
  --navy: #14335E;
  --blue-accent: #1A5FA8;
  --blue-light: #9FC3EF;
  --bg-base: #FBFCFE;
  --text-muted: #5B6680;
  /* Footer-only muted tone. #5B6680 clears 4.5:1 on the flat page
     background, but the footer sits over the bottom-left orb and the
     shell gradient, and on that composite (~#E0E7F2) it lands at 4.615:1
     — a 0.1 margin on 12.5px text. This darker tone holds ~5.98:1 there
     and 7.24:1 on flat background. */
  --text-muted-footer: #4A5570;
  --radius-pill: 100px;
  /* Results-page CTA accent (T-16-39, Gal approved 2026-10-12) — Pantone
     1235 C. The only non-navy/blue color in the palette, kept here
     rather than as a results.css-local override so it reads as a real
     brand decision, not a one-off. Not used on the survey form itself. */
  --gold: #FFC72C;
  --gold-dark: #E6B000;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

html, body {
  height: 100%;
  font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ------- Scene (background + orbs, matches mockup) ------- */
.app-shell {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% -10%, rgba(46, 134, 222, .16) 0%, transparent 45%),
    radial-gradient(circle at -10% 110%, rgba(20, 51, 94, .10) 0%, transparent 45%),
    var(--bg-base);
}
.bg-orbs { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.bg-orbs::before,
.bg-orbs::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .35;
}
.bg-orbs::before {
  width: 300px; height: 300px;
  background: var(--blue-light);
  top: -110px; right: -80px;
}
.bg-orbs::after {
  width: 240px; height: 240px;
  background: #C6D9F2;
  bottom: -80px; left: -60px;
  opacity: .3;
}

/* ------- Top bar ------- */
.top-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand-mark {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}
.brand-text {
  font-weight: 800;
  font-size: 14px;
  color: var(--navy);
}
/* ------- Progress ------- */
.progress-track {
  position: relative;
  z-index: 2;
  height: 3px;
  background: #E2E8F2;
  flex-shrink: 0;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue-accent), var(--navy));
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}
.progress-meta {
  position: absolute;
  top: 22px;
  left: 40px;
  z-index: 2;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ------- Content ------- */
#screen-root {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Screen entrance animation + content layout (each screen renders as .screen) */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 60px 40px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  animation: screenIn 0.55s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------- Intro logo ------- */
.intro-logo-wrap {
  width: 100%;
  text-align: right;
  margin-bottom: 24px;
}
.intro-logo {
  display: inline-block;
  height: 67px;
  width: auto;
  object-fit: contain;
}

/* ------- Typography ------- */
.eyebrow {
  display: inline-block;
  color: var(--blue-accent);
  font-weight: 700;
  font-size: 13.8px;
  letter-spacing: 1px;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.screen-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.3px;
  color: var(--navy);
  margin-bottom: 16px;
}
.screen-body {
  font-size: 15.5px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 26px;
  max-width: 60ch;
}

.inline-link {
  color: var(--blue-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.inline-link:hover { color: var(--navy); }

/* ------- Intro screen — enlarged type (20% over base) ------- */
.intro-eyebrow { font-size: 13.8px; }
.intro-title { font-size: 38.4px; }
.intro-body { font-size: 18.6px; }

/* ------- Primary button ------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  padding: 15px 32px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--blue-accent), var(--navy));
  box-shadow: 0 12px 28px rgba(20, 51, 94, .25);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease, filter .25s ease;
  margin-top: 22px;
  width: fit-content;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(20, 51, 94, .35);
  filter: brightness(1.03);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary svg { width: 18px; height: 18px; }
.btn-primary:disabled,
.btn-primary[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 12px -4px rgba(46, 134, 222, 0.3);
  filter: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  color: var(--blue-accent);
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  background: rgba(46, 134, 222, 0.10);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), background .25s ease, color .25s ease;
  margin-top: 8px;
  width: fit-content;
}
.btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(46, 134, 222, 0.18);
  color: var(--navy);
}
.btn-secondary svg { width: 18px; height: 18px; }

@media (max-width: 640px) {
  .top-bar { padding: 16px 22px; }
  .screen { padding: 10px 24px 24px; }
  .screen-title { font-size: 21px; }
  .screen-body { font-size: 13px; margin-bottom: 18px; }
  .intro-title { font-size: 25.2px; }
  .intro-body { font-size: 15.6px; }
}

/* ------- Rating scale ------- */
.rating-row {
  display: flex;
  gap: 12px;
  margin: 26px 0 10px;
}
.rating-btn {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 16px;
  border: 1.5px solid #E2E8F2;
  background: #fff;
  color: var(--navy);
  font-family: inherit;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(20, 51, 94, .04);
  transition: all .25s cubic-bezier(.34, 1.56, .64, 1);
}
.rating-btn:hover:not(.is-selected) {
  border-color: var(--blue-light);
  transform: translateY(-3px);
}
.rating-btn.is-selected {
  background: linear-gradient(135deg, var(--blue-accent), var(--navy));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 26px rgba(46, 134, 222, .4);
  transform: scale(1.08);
}
.rating-btn.is-pop {
  animation: ratingPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ratingPop {
  0%   { transform: scale(1.08); }
  40%  { transform: scale(1.22); }
  70%  { transform: scale(1.02); }
  100% { transform: scale(1.08); }
}
.rating-captions {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 8px;
}
.screen-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  vertical-align: top;
}
.screen-actions .btn-primary,
.screen-actions .back-link {
  text-align: center;
  justify-content: center;
  margin-top: 0;
}
.screen-actions .btn-primary { margin-top: 22px; }
.screen-actions .back-link { margin-top: 0; }

@media (max-width: 640px) {
  .rating-row { gap: 8px; }
  .rating-btn { font-size: 16px; border-radius: 12px; }
}

/* ------- Barriers (multi-select) ------- */
.barrier-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 8px;
}
.barrier-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid #E2E8F2;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 51, 94, .04);
  transition: border-color 0.2s ease, background 0.2s ease, transform .2s ease;
}
.barrier-option:hover { border-color: var(--blue-light); transform: translateY(-1px); }
.barrier-option.is-selected {
  border-color: transparent;
  background: rgba(46, 134, 222, 0.06);
  box-shadow: 0 0 0 1.5px var(--blue-accent) inset;
}
.barrier-option input.barrier-checkbox {
  position: absolute;
  opacity: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  pointer-events: none;
}
.barrier-checkbox:focus-visible + .barrier-check,
.consent-row input[type="checkbox"]:focus-visible + .barrier-check {
  outline: 2px solid var(--blue-accent);
  outline-offset: 2px;
}
.barrier-check {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(20, 51, 94, 0.25);
  display: grid;
  place-items: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.barrier-option.is-selected .barrier-check,
.consent-row.is-selected .barrier-check {
  background: var(--blue-accent);
  border-color: var(--blue-accent);
  transform: scale(1.05);
}
.barrier-option.is-selected .barrier-check::after,
.consent-row.is-selected .barrier-check::after {
  content: "";
  width: 6px;
  height: 11px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
}
.barrier-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--navy);
}
.barrier-other-input {
  margin-top: 4px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid #E2E8F2;
  font-family: inherit;
  font-size: 15px;
  color: var(--navy);
  outline: none;
  transition: border-color 0.2s ease;
}
.barrier-other-input:focus { border-color: var(--blue-accent); }
.barrier-limit-msg {
  font-size: 13px;
  color: #c0392b;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .barrier-option { padding: 12px 14px; }
  .barrier-label { font-size: 14px; }
}

/* ------- Open text questions ------- */
.open-textarea {
  width: 100%;
  margin: 12px 0 8px;
  padding: 18px;
  border-radius: 16px;
  border: 1.5px solid #E2E8F2;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--navy);
  resize: none;
  min-height: 110px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s ease;
}
.open-textarea::placeholder { color: var(--text-muted); }
.open-textarea:focus { border-color: var(--blue-accent); }

/* ------- Personal details form ------- */
.field-group {
  margin-bottom: 18px;
  text-align: right;
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
}
.field-input,
.field-textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid #E2E8F2;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--navy);
  background: #fff;
  outline: none;
  transition: border-color 0.2s ease;
}
.field-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.field-input:focus,
.field-textarea:focus { border-color: var(--blue-accent); }
.field-input::placeholder,
.field-textarea::placeholder { color: var(--text-muted); }

.field-file {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-muted);
}
.field-file::file-selector-button {
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--navy);
  background: rgba(46, 134, 222, 0.1);
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  margin-inline-end: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.field-file::file-selector-button:hover { background: rgba(46, 134, 222, 0.18); }

.photo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.photo-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #E2E8F2;
}
.photo-status {
  font-size: 13px;
  color: var(--text-muted);
}

.consent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid #E2E8F2;
  background: #fff;
  cursor: pointer;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(20, 51, 94, .04);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.consent-row:hover { border-color: var(--blue-light); }
.consent-row.is-selected {
  border-color: transparent;
  background: rgba(46, 134, 222, 0.06);
  box-shadow: 0 0 0 1.5px var(--blue-accent) inset;
}
.consent-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  pointer-events: none;
}

.field-error {
  font-size: 13px;
  color: #c0392b;
  margin-bottom: 12px;
}

/* ------- Thank you screen ------- */
.thank-you-wrap { text-align: center; }
.thank-you-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--blue-accent), var(--navy));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 16px 40px rgba(20, 51, 94, .3);
  animation: pop .6s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.thank-you-icon svg { width: 34px; height: 34px; }
.thank-you-wrap .screen-title,
.thank-you-wrap .screen-body { text-align: center; margin-inline: auto; }
.thank-you-wrap .btn-secondary { margin-inline: auto; margin-top: 20px; }

/* ------- Footer ------- */
.app-footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 24px 22px;
  font-size: 12.5px;
  color: var(--text-muted-footer);
  flex-shrink: 0;
  text-align: center;
}
.app-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.app-footer a,
.app-footer-link {
  color: inherit;
  text-decoration: none;
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.app-footer a:hover,
.app-footer-link:hover { color: var(--blue-accent); text-decoration: underline; }
.app-footer-sep { color: #C7D1E0; }

/* ------- Privacy modal ------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(20, 51, 94, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 30px 70px rgba(20, 51, 94, .25);
}
.modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  border-radius: 999px;
  transition: background 0.2s ease;
}
.modal-close:hover { background: rgba(20, 51, 94, 0.06); }
.modal-close svg { width: 18px; height: 18px; }
.modal-title {
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 16px;
}
/* The body owns the scroll, not the card. A scrollable region has to be
   reachable by keyboard, and these modals hold a single focusable element
   (the close button) — so a scrolling card left its own text unreachable
   in Firefox and Safari. The tabindex="0" in the markup joins the body to
   the focus trap, whose selector already matches [tabindex]. */
.modal-body {
  overflow-y: auto;
  min-height: 0;
}
.modal-body:focus-visible {
  outline: 2px solid var(--blue-accent);
  outline-offset: 4px;
  border-radius: 4px;
}
.modal-body p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.modal-body p:last-child { margin-bottom: 0; }
.modal-body ul {
  margin: 0 0 12px;
  padding-inline-start: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}
.modal-body li { margin-bottom: 4px; }

/* ------- In-card back affordance ------- */

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 16px 0 0 0;
  padding: 8px 18px;
  border: none;
  background: transparent;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.back-link:hover { color: var(--navy); background: rgba(46, 134, 222, 0.08); }
.back-link:focus-visible { outline: 2px solid var(--blue-accent); outline-offset: 2px; }
