/* =============================================================================
 * styles.css — appearance of the Digital Help Finder
 * -----------------------------------------------------------------------------
 * Colours and spacing are set as CSS variables in :root so you can re-brand
 * quickly. Designed mobile-first with large touch targets and strong contrast,
 * since many users will be on phones or new to using the web.
 * ========================================================================== */

:root {
  --brand: #2e3192;          /* primary indigo (matches the owl backdrop) */
  --brand-dark: #20235f;     /* darker indigo for text, hovers, headings */
  --brand-light: #e6e7f6;    /* pale indigo tint for chips and highlights */
  --accent: #b8003e;         /* used sparingly for emphasis */
  --ink: #1a1c2e;            /* main text (slightly indigo-tinted) */
  --ink-soft: #555873;       /* secondary text */
  --bg: #f4f6f6;             /* light surface for inner boxes */
  --page-bg: #2e3192;        /* deep indigo behind everything (owl backdrop) */
  --bar-bg: #1c1e57;         /* darker indigo for the header and footer bars */
  --card: #ffffff;
  --line: #d6dedd;
  --focus: #ffbf47;          /* high-visibility focus ring */
  --radius: 12px;
  --maxw: 720px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--page-bg);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: transparent;
  /* Sticky-footer layout: the page fills at least the viewport, and the main
     content grows so the footer is pushed to the bottom even on short pages. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

main {
  flex: 1 0 auto;
}

/* Indigo backdrop with the owl artwork on a fixed layer behind everything.
   Using a fixed pseudo-element (rather than background-attachment: fixed on the
   body) keeps the owl viewport-sized on long pages and avoids the known mobile
   bugs with fixed backgrounds. The indigo shows on its own until the image
   loads, so it always looks intentional. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--page-bg);
  background-image: url("../img/owl-bg.jpg");
  background-repeat: no-repeat;
  background-position: top left;
  background-size: cover;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ----- Skip link & focus -------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ----- Header / footer ---------------------------------------------------- */
.site-header {
  background: var(--bar-bg);
  color: #fff;
  padding: 0.9rem 0;
}
.site-header .container {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.brand { font-weight: 700; font-size: 1.25rem; margin: 0; }
.brand-place {
  margin: 0;
  font-weight: 600;
  opacity: 0.9;
  border-left: 2px solid rgba(255, 255, 255, 0.5);
  padding-left: 0.5rem;
}

.site-footer {
  margin-top: 2.5rem;
  padding: 1.5rem 0;
  background: var(--bar-bg);
  color: #c8caea;
  font-size: 0.95rem;
}
.site-footer p { margin: 0; }

/* ----- Demo banner -------------------------------------------------------- */
.demo-banner {
  background: #fff4d6;
  border: 1px solid #e6c65a;
  color: #5b4708;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  margin: 1rem 0 0;
  font-size: 0.95rem;
}

/* ----- Card --------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.25rem 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

h2 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 0.5rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 0.5rem; }

/* ----- Intro -------------------------------------------------------------- */
.intro .lead { font-size: 1.15rem; color: var(--ink); }
.intro-points {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 1.5rem;
}
.intro-points li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: 0.6rem;
}
.intro-points li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand);
  font-weight: 700;
}

/* ----- Progress ----------------------------------------------------------- */
.progress { margin-bottom: 1.25rem; }
.progress-bar {
  height: 8px;
  background: var(--brand-light);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.progress-text {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ----- Question ----------------------------------------------------------- */
.question { border: 0; margin: 0; padding: 0; }
.question legend { width: 100%; padding: 0; }
.eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 0.25rem;
}
.question-text { margin: 0 0 0.5rem; }
.help { color: var(--ink-soft); margin: 0 0 1rem; }

.required-note {
  background: #fde8ec;
  border: 1px solid var(--accent);
  color: #80012b;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

/* ----- Options ------------------------------------------------------------ */
.options { display: grid; gap: 0.6rem; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}
.option:hover { border-color: var(--brand); background: var(--brand-light); }
.option input {
  margin-top: 0.2rem;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  accent-color: var(--brand);
}
.option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-light);
}
.option-label { display: flex; flex-direction: column; }
.option-title { font-weight: 600; }
.option-hint { color: var(--ink-soft); font-size: 0.95rem; }

/* ----- Navigation buttons ------------------------------------------------- */
.nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.results-nav { justify-content: flex-start; }

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 48px;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost {
  background: #fff;
  color: var(--brand-dark);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--brand); }
.btn-lg { font-size: 1.1rem; padding: 0.85rem 2rem; }

/* ----- Results ------------------------------------------------------------ */
.summary-line { font-size: 1.1rem; }
.results-group-title { color: var(--brand-dark); }
.maybe-note { color: var(--ink-soft); margin-top: 0; }

.offer-list { display: grid; gap: 1rem; margin-top: 0.75rem; }

.offer {
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  background: #fff;
}
.offer-maybe { border-left-color: #d89a00; background: #fffdf5; }

.offer-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.offer-org {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-dark);
}
.offer-name { margin: 0.15rem 0 0; font-size: 1.15rem; }

.offer-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.offer-summary { margin: 0.6rem 0; }
.offer-how { margin: 0.6rem 0; }
.offer-contact {
  list-style: none;
  padding: 0.75rem;
  margin: 0.6rem 0 0;
  background: var(--bg);
  border-radius: 8px;
}
.offer-contact li { margin-bottom: 0.25rem; }
.offer-contact li:last-child { margin-bottom: 0; }
.contact-key { font-weight: 600; }
.offer-contact a { color: var(--brand-dark); word-break: break-word; }
.offer-notes {
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-style: italic;
}

.empty {
  background: var(--brand-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

/* ----- Wider screens ------------------------------------------------------ */
@media (min-width: 600px) {
  body { font-size: 1.1rem; }
  .card { padding: 2rem; }
}

/* ----- Print -------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .demo-banner,
  .progress,
  .nav,
  .skip-link { display: none !important; }
  body { background: #fff; }
  .card, .offer { box-shadow: none; border-color: #999; }
  .offer { break-inside: avoid; }
}

/* ----- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
