/* ==========================================================================
   GoApply web design system
   Tokens mirror the iOS app's Q palette (paperV3) from ios-native/DESIGN.md.
   Rules carried over from the app: no shadows anywhere, hairline borders,
   hue-stepped surfaces, Barlow ExtraBold for display, Plus Jakarta Sans body.
   ========================================================================== */

/* --- Fonts (self hosted, no external requests) --------------------------- */
@font-face {
  font-family: "Barlow";
  src: url("/fonts/Barlow-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/PlusJakartaSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/PlusJakartaSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/PlusJakartaSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens -------------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg: #f2f2f2;
  --paper: #ffffff;
  --raised: #e9e7e4;
  --pale: #f2f5ff;

  /* Text */
  --ink: #131313;
  --ink-soft: #4a4a4a;
  --mut: #4a4a4a;
  --slate: #6e7480;

  /* Lines */
  --line: #dfe1e7;
  --slate-mid: #d8dbe2;

  /* Accent */
  --accent: #1f4cf5;
  --accent-dark: #4c7dff; /* the onboarding dark-section accent */
  --on-accent: #ffffff;
  --danger: #e01f1f;

  /* Status dots, from the detail-view fact list */
  --ok: #3cb371;
  --warn: #f0a93c;
  --bad: #ff6359;

  /* Shape */
  --r-card: 24px;
  --r-sm: 14px;
  --r-pill: 999px;

  /* Rhythm */
  --gut: 22px;
  --maxw: 1120px;

  --display: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Exactly the sticky header height. Do NOT also set scroll-margin-top on
     the sections: the two offsets compound, the anchor lands ~168px low, and
     the tail of the previous section is left clipped under the header. */
  scroll-padding-top: 68px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Keeps the footer pinned to the bottom on short pages (an error state, a
     stub legal page) instead of floating mid-screen over a grey void. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
}

p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.wrap-narrow {
  max-width: 760px;
}

.accent {
  color: var(--accent);
}

.eyebrow {
  font-family: var(--body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 14px;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  padding: 17px 28px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn-accent {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-accent:hover {
  background: #1740db;
}

.btn-ink {
  background: var(--ink);
  color: #fff;
}

.btn-ink:hover {
  background: #000;
}

.btn-light {
  background: #fff;
  color: var(--ink);
}

.btn-light:hover {
  background: #f0f0f0;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: var(--paper);
}

.btn-sm {
  padding: 12px 20px;
  font-size: 15px;
}

/* --- Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  /* Nearly opaque on purpose. At 0.88 the black Features section bleeding
     through turned the header into a muddy grey slab, so its colour changed
     depending on which section was underneath it. */
  background: rgba(242, 242, 242, 0.97);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand img {
  height: 22px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

.header-cta {
  flex-shrink: 0;
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
  padding: 78px 0 0;
  text-align: center;
}

.hero h1 {
  font-size: clamp(40px, 7.2vw, 76px);
  max-width: 15ch;
  margin: 0 auto 22px;
}

.hero .lede {
  font-size: clamp(17px, 2.1vw, 20px);
  color: var(--ink-soft);
  max-width: 58ch;
  margin: 0 auto 30px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.hero-note {
  font-size: 14px;
  color: var(--slate);
  margin-top: 14px;
}

.hero-shot {
  margin: 54px auto 0;
  max-width: 340px;
}

/* --- Device frame -------------------------------------------------------- */
.device {
  position: relative;
  border-radius: 46px;
  border: 1px solid var(--slate-mid);
  background: var(--ink);
  padding: 9px;
  overflow: hidden;
}

.device img {
  border-radius: 38px;
  width: 100%;
  display: block;
}

.device-sm {
  border-radius: 34px;
  padding: 6px;
}

.device-sm img {
  border-radius: 28px;
}

/* --- Sections ------------------------------------------------------------ */
/* No scroll-margin-top here on purpose. html's scroll-padding-top already
   clears the sticky header; setting both makes the offsets add up. */

.section {
  padding: 92px 0;
}

/* An anchored section still needs breathing room under the header even when
   it is visually joined to the section above it (padding-top 0). */
.section.joined {
  padding-top: 0;
}

.section.joined[id] {
  padding-top: 40px;
}

.section-head {
  max-width: 30ch;
  margin-bottom: 44px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  margin-bottom: 14px;
}

.section-head p {
  font-family: var(--body);
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 56ch;
}

.section-head.center p {
  margin-left: auto;
  margin-right: auto;
}

/* --- Stat strip (replaces the ratings badge) ----------------------------- */
.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  padding: 34px 0;
  margin-top: 78px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}

.stat-n {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 3.6vw, 40px);
  letter-spacing: -0.03em;
  line-height: 1;
  display: block;
}

.stat-l {
  font-size: 14px;
  color: var(--slate);
  margin-top: 8px;
  display: block;
}

/* --- Steps --------------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 26px 24px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.step-n {
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.step h3 {
  font-size: 23px;
  margin-bottom: 10px;
}

.step p {
  color: var(--ink-soft);
  font-size: 15.5px;
  margin-bottom: 24px;
}

.step-shot {
  margin-top: auto;
  max-width: 220px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  transform: translateY(10px);
}

/* --- Programs / logo grid ------------------------------------------------ */
.logos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.logo-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 10px 18px 10px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
}

.logo-pill .logo-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}

.logo-pill.text-pill {
  padding: 10px 18px;
}

.logos-note {
  text-align: center;
  font-size: 13.5px;
  color: var(--slate);
  margin-top: 26px;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

/* --- Feature grid -------------------------------------------------------- */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.feature {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 24px 22px;
}

.feature .ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--pale);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature .ico svg {
  width: 19px;
  height: 19px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature h3 {
  font-size: 18px;
  margin-bottom: 7px;
}

.feature p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.feature-wide {
  grid-column: span 2;
}

/* --- Dark takeover ------------------------------------------------------- */
.dark {
  background: #000;
  color: #fff;
}

.dark h2,
.dark h3 {
  color: #fff;
}

.dark .accent {
  color: var(--accent-dark);
}

.dark p {
  color: rgba(255, 255, 255, 0.72);
}

.dark .eyebrow {
  color: rgba(255, 255, 255, 0.5);
}

/* Light-surface cards sitting INSIDE a dark section keep their own ink.
   Without this the blanket .dark h3 / .dark p rules above win on source
   order and paint white text onto a white card, which renders the whole
   feature grid invisible. Any new light card inside .dark needs adding here. */
.dark .feature h3,
.dark .logo-pill {
  color: var(--ink);
}

.dark .feature p {
  color: var(--ink-soft);
}

.cta-final {
  padding: 104px 0;
  text-align: center;
}

.cta-final h2 {
  font-size: clamp(34px, 5.6vw, 60px);
  max-width: 17ch;
  margin: 0 auto 18px;
}

.cta-final p {
  font-size: 18px;
  max-width: 52ch;
  margin: 0 auto 32px;
}

/* --- Match/Quality bars (mirrors the in-app spectrum bars) --------------- */
.bars {
  display: grid;
  gap: 18px;
  max-width: 420px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--slate);
}

.bar-top b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.bar-track {
  height: 9px;
  border-radius: var(--r-pill);
  background: var(--raised);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.bar-fill.ok {
  background: var(--ok);
}

/* --- FAQ ----------------------------------------------------------------- */
.faq {
  max-width: 800px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 24px 40px 24px 0;
  position: relative;
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.015em;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-right: 2px solid var(--slate);
  border-bottom: 2px solid var(--slate);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.18s ease;
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq .answer {
  padding: 0 0 26px;
  color: var(--ink-soft);
  font-size: 16.5px;
  max-width: 66ch;
}

.faq .answer p + p {
  margin-top: 12px;
}

/* --- Footer -------------------------------------------------------------- */
.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 60px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 36px;
  padding-bottom: 40px;
}

.footer-brand img {
  height: 22px;
  margin-bottom: 14px;
}

.footer-brand p {
  font-size: 14.5px;
  color: var(--slate);
  max-width: 34ch;
}

.footer-col h4 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  font-size: 15px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 5px 0;
}

.footer-col a:hover {
  color: var(--ink);
}

/* On the short pages (signup, welcome) the footer is only this base row, and
   its divider would be an orphaned rule sitting under empty space with
   nothing above it to separate. */
.footer-base:first-child {
  border-top: 0;
  padding-top: 0;
}

.footer-base {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--slate);
}

.footer-base p {
  max-width: 70ch;
}

/* --- Legal / doc pages --------------------------------------------------- */
.doc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 48px 46px 56px;
  margin: 56px auto 80px;
  max-width: 820px;
}

.doc h1 {
  font-size: clamp(30px, 4.6vw, 42px);
  margin-bottom: 10px;
}

.doc .updated {
  color: var(--slate);
  font-size: 14.5px;
  margin-bottom: 34px;
}

.doc h2 {
  font-size: 21px;
  margin: 38px 0 10px;
}

.doc h3 {
  font-size: 17px;
  margin: 24px 0 8px;
}

.doc p,
.doc li {
  color: var(--ink-soft);
  font-size: 16px;
}

.doc p + p {
  margin-top: 12px;
}

.doc ul,
.doc ol {
  padding-left: 22px;
  margin: 12px 0;
}

.doc li {
  margin-bottom: 7px;
}

.doc a {
  color: var(--accent);
}

.doc strong {
  color: var(--ink);
  font-weight: 600;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 6px;
  font-size: 15px;
}

.doc th,
.doc td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.doc th {
  color: var(--ink);
  font-weight: 600;
}

.doc td {
  color: var(--ink-soft);
}

.table-scroll {
  overflow-x: auto;
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 940px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-wide {
    grid-column: span 2;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .step-shot {
    max-width: 250px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .site-nav {
    display: none;
  }

  .section {
    padding: 68px 0;
  }

  .hero {
    padding-top: 54px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 20px;
  }

  .cta-final {
    padding: 76px 0;
  }

  .doc {
    padding: 34px 24px 42px;
    margin: 32px auto 60px;
    border-radius: 20px;
  }

  .hero-cta .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .features {
    grid-template-columns: 1fr;
  }

  .feature-wide {
    grid-column: span 1;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
