/* =========================================================
   JAO — main stylesheet
   ---------------------------------------------------------
   HOW TO EDIT
   - Colors, fonts and spacing live in the ":root" block
     right below. Change a value there and it updates
     everywhere on the site.
   - Styles are written for phones first. The "@media"
     blocks near each section add changes for wider screens.
   ========================================================= */


/* ===== 1. SETTINGS (colors, fonts, spacing) ===== */
:root {
  /* Brand colors (taken from the logo) */
  --charcoal: #111827;   /* headings, body text, footer */
  --navy: #0B2545;       /* JAO logo color: buttons, links, accents, dark sections */
  --navy-hover: #1D4E89; /* button and link hover */
  --error: #C8102E;      /* error messages only */
  --white: #FFFFFF;
  --gray-bg: #EAEFF5;    /* alternating section background */
  --border: #E5E7EB;     /* card outlines, dividers */

  /* Fonts */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Spacing and shapes */
  --max-width: 72rem;    /* widest the content gets */
  --gutter: 1.25rem;     /* space at the left/right edges */
  --section-space: clamp(3rem, 8vw, 5.5rem);
  --radius: 0.75rem;
}


/* ===== 2. FONT FILE ===== */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/inter.woff2") format("woff2");
}


/* ===== 3. BASICS ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--white);
  -webkit-text-size-adjust: 100%;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;   /* spreads words evenly across lines (no lone last word) */
}

h1 { font-size: clamp(2.1rem, 6vw, 2.9rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.25rem); }
h3 { font-size: 1.15rem; }

p {
  margin: 0 0 1rem;
}

a {
  color: var(--navy);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--navy-hover);
}

/* Keyboard focus outline — always visible */
:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Turn off smooth scrolling and transitions for people who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}


/* ===== 4. LAYOUT HELPERS ===== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-space);
}

.section--gray {
  background: var(--gray-bg);
}

.section-intro {
  max-width: 42rem;
  margin-bottom: 2.5rem;
}

.center {
  text-align: center;
  margin-inline: auto;
}

/* Text only screen readers can hear */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* "Skip to content" link — appears when you press Tab */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--charcoal);
  color: var(--white);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
  color: var(--white);
}


/* ===== 5. BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.875rem;           /* easy to tap */
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--navy);
  border-radius: 0.5rem;
  background: var(--navy);
  color: var(--white);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn:hover {
  background: var(--navy-hover);
  border-color: var(--navy-hover);
  color: var(--white);
}

/* White button with a navy outline */
.btn--outline {
  background: var(--white);
  border-color: var(--navy);
  color: var(--navy);
}

.btn--outline:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.btn--full {
  width: 100%;
}

/* ===== 6. HEADER ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.875rem;
}

.logo img {
  width: 8.5rem;
}

.header-cta {
  padding: 0.5rem 1rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
}

/* The page links wrap onto their own row on phones */
.main-nav {
  order: 3;
  width: 100%;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--charcoal);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.main-nav a:hover {
  border-bottom-color: var(--border);
}

/* Highlights the page you are on */
.main-nav a[aria-current="page"] {
  border-bottom-color: var(--navy);
}

/* Phones: keep the header to two short rows (logo + button, then the 3 links) */
@media (max-width: 39.99em) {
  .header-inner {
    gap: 0.25rem 0.75rem;
    padding-block: 0.625rem 0.25rem;
  }
  .logo img {
    width: 7.25rem;
  }
  .header-cta {
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
  }
  .main-nav ul {
    justify-content: space-between;
    gap: 0 0.75rem;
  }
  .main-nav a {
    font-size: 0.9375rem;
  }
}

/* The narrowest phones (about 350px and below) */
@media (max-width: 22em) {
  .main-nav ul {
    gap: 0 0.5rem;
  }
  .main-nav a {
    font-size: 0.875rem;
  }
}

@media (min-width: 52em) {
  .main-nav {
    order: 0;
    width: auto;
    margin-left: auto;
  }
  .main-nav ul {
    gap: 2rem;
  }
}


/* ===== 7. HERO (top section of each page) ===== */
.hero {
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero-tagline {
  margin-top: 1rem;
}

.hero-img {
  width: 100%;
  border-radius: var(--radius);
}

@media (min-width: 64em) {
  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 3.5rem;
  }
}


/* ===== 8. CARDS AND GRIDS ===== */
.grid {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40em) {
  .grid--2,
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* Four across only when there's room (about 1120px+); 2 × 2 on small laptops and tablets */
@media (min-width: 70em) {
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card p:last-child {
  margin-bottom: 0;
}

.card p {
  color: var(--charcoal);
}

/* Small line icon at the top of a card */
.card-icon {
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  padding: 0.6rem;
  border-radius: 0.5rem;
  background: var(--gray-bg);
  color: var(--navy);
}

.card-icon svg {
  width: 100%;
  height: 100%;
}


/* ===== 9. NUMBERED STEPS ===== */
.steps {
  counter-reset: step;
}

.step {
  counter-increment: step;
}

/* A second topic inside the same section, set apart with space and a thin line */
.subsection {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid #CBD5E1;   /* a shade darker than --border so it shows on soft gray */
}

/* Even out line endings so no word sits alone on the last line */
.step p {
  text-wrap: pretty;
}

.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
}


/* ===== 10. TWO-COLUMN TEXT + IMAGE ===== */
.split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.split--top {
  align-items: start;
}

.split img {
  width: 100%;
  border-radius: var(--radius);
}

@media (min-width: 64em) {
  .split { grid-template-columns: 1fr 1fr; gap: 4rem; }
}


/* ===== 11. PRICING ===== */
.price-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.price-card h3 {
  margin-bottom: 0.25rem;
}

/* Highlighted package ("Best value") — red outline plus a small label */
.price-card--best {
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy);   /* thicker outline without shifting the contents */
}

.badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  vertical-align: 0.15em;
}

.price {
  margin: 0.25rem 0 0.75rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

/* "/ application" sits on the same line as the price */
.price-unit {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--charcoal);
}

.price-range {
  margin-bottom: 0.25rem;
  font-weight: 600;
  text-wrap: balance;   /* "For orders of / 1–10 applications" instead of a lone word */
}

.price-card .btn {
  margin-top: auto;
}

/* Package cards on the pricing page: each row (name, price, range,
   description, button) lines up across all four cards, even when
   one card's text wraps onto more lines than the others. */
@supports (grid-template-rows: subgrid) {
  .price-grid .price-card {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    row-gap: 0;
  }
  .price-grid .price-card .btn {
    margin-top: 0;
    align-self: end;
  }
}

/* The price calculator box */
.calculator {
  max-width: 40rem;
  margin: 3rem auto 0;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
}

.calculator h3 {
  font-size: 1.35rem;
}

/* "How is my total calculated? (i)" — bottom right of the calculator.
   The pop-up opens upward from it. */
.info {
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.info-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;          /* big enough to tap */
  padding: 0;
  border: 0;
  background: none;
  color: var(--charcoal);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.info-btn:hover,
.info.is-open .info-btn {
  color: var(--charcoal);
}

.info-label {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.2em;
}

/* The round (i) */
.info-btn span[aria-hidden] {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  font: 700 0.875rem/1 var(--font);
}

.info-btn:hover span[aria-hidden],
.info.is-open .info-btn span[aria-hidden] {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.info-pop {
  display: none;
  position: absolute;
  bottom: 100%;
  right: 0;
  z-index: 10;
  width: min(26rem, 100%);
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.15);
  text-align: left;
}

.info-pop p:last-child {
  margin-bottom: 0;
}

/* Show the pop-up on mouse hover, or after a tap/click/keyboard press */
.info-btn:hover + .info-pop,
.info-pop:hover,
.info.is-open .info-pop {
  display: block;
}

/* After Esc, keep it closed until the mouse moves away */
.info.is-dismissed .info-pop {
  display: none;
}

.calc-results {
  display: grid;
  gap: 0.5rem;
  margin: 1.5rem 0;
  padding: 1.25rem 0;
  border-block: 1px solid var(--border);
}

/* Each row: label on the left, amount on the right */
.calc-results div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.calc-total {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.calc-results dt {
  color: var(--charcoal);
}

.calc-results dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.calc-total dt,
.calc-total dd {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--charcoal);
}

.calc-message {
  margin: 0.5rem 0 0;
  color: var(--error);
  font-weight: 600;
}

.calc-note {
  margin: 1rem 0 0;
}

.example-list {
  padding-left: 1.25rem;
}


/* ===== 12. FORMS ===== */
.field {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.hint {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  color: var(--charcoal);
}

input,
textarea {
  width: 100%;
  min-height: 2.875rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #9CA3AF;   /* darker than --border so the box is easy to see */
  border-radius: 0.5rem;
  background: var(--white);
  color: var(--charcoal);
  font: inherit;
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible {
  outline-offset: 1px;
  border-color: var(--charcoal);
}

/* Make sure anything marked "hidden" really is hidden */
[hidden] {
  display: none !important;
}

.optional {
  font-weight: 400;
  color: var(--charcoal);
}

/* Spam trap — kept off-screen so people never see it */
.bot-trap {
  position: absolute;
  left: -9999px;
}

.form-error {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--error);
  background: #FDECEE;
  color: var(--charcoal);
  font-weight: 500;
}

/* Thank-you message after sending */
.form-success {
  padding-block: 1.5rem;
  text-align: center;
}

.form-success:focus {
  outline: none;
}

.form-success p {
  max-width: 28rem;
  margin-inline: auto;
}

.success-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  padding: 0.85rem;
  border-radius: 50%;
  background: var(--gray-bg);
  color: var(--navy);
}


/* ===== 13. FAQ (click-to-open questions) ===== */
.faq {
  max-width: 48rem;
}

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

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-block: 1.1rem;
  font-weight: 600;
  font-size: 1.0625rem;
  cursor: pointer;
  list-style: none;
}

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

/* The + / – sign on the right */
.faq summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--navy);
}

.faq details[open] summary::after {
  content: "–";
}

.faq .answer {
  padding-bottom: 1.1rem;
  color: var(--charcoal);
}

.faq .answer ul {
  margin: 0 0 1rem;
}


/* ===== 14. CALL-TO-ACTION BAND ===== */
.cta-band {
  text-align: center;
  background: var(--navy);
  color: var(--white);
}

.cta-band p {
  max-width: 36rem;
  margin-inline: auto;
  color: var(--white);
  text-wrap: balance;   /* centered text splits into even lines (no word left alone) */
}

/* On the navy band, buttons are white with navy text so they stand out */
.cta-band .btn {
  margin-top: 0.75rem;
  background: var(--white);
  border-color: var(--white);
  color: var(--navy);
}

.cta-band .btn:hover {
  background: #DCE6F2;
  border-color: #DCE6F2;
  color: var(--navy);
}

/* Keyboard outline must show on the dark background too */
.cta-band :focus-visible {
  outline-color: var(--white);
}


/* ===== 15. SMALL PRINT / NOTICES ===== */
.notice {
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--navy);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--gray-bg);
}

.notice p:last-child {
  margin-bottom: 0;
}

/* Contact page: the three email addresses */
.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  margin-bottom: 0.75rem;
  overflow-wrap: anywhere;   /* long email addresses never stick out on small phones */
}

.contact-list strong {
  display: block;
}

.check-list {
  padding-left: 1.25rem;
}

.check-list li {
  margin-bottom: 0.4rem;
}

/* Simple text pages (privacy, terms, 404) */
.prose {
  max-width: 44rem;
}

/* Long policy pages: clear spacing between numbered sections */
.policy h2 {
  margin-top: 2.75rem;
  font-size: 1.5rem;
}

.policy h3 {
  margin-top: 1.5rem;
}

.policy ul {
  padding-left: 1.25rem;
}

.policy li {
  margin-bottom: 0.4rem;
}

.policy .notice {
  margin-block: 2rem;
}

.policy .glance-title {
  margin-top: 0;
  font-size: 1.15rem;
}

/* Clickable table of contents */
.toc {
  margin-bottom: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.policy .toc h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.5rem;
  columns: 2 16rem;     /* two columns when there's room */
  column-gap: 2rem;
}

.toc li {
  margin-bottom: 0.25rem;
}

/* Yellow highlight on text that still needs to be filled in */
mark.fill {
  padding: 0 0.2rem;
  background: #FFF3B0;
  color: var(--charcoal);
}

/* When used on a .container, keep it lined up with the rest of the page */
.container.prose {
  max-width: var(--max-width);
}

.container.prose > * {
  max-width: 44rem;
}


/* ===== 16. FOOTER ===== */
.site-footer {
  padding-block: 3rem 2rem;
  background: var(--navy);
  border-top: 1px solid rgba(255, 255, 255, 0.18);   /* separates it from the navy band above */
  color: var(--white);
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

.footer-logo {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--white);
}

.footer-logo img {
  width: 7.5rem;
}

.site-footer h2 {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  color: var(--white);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--white);
  text-decoration: underline;
}

.site-footer :focus-visible {
  outline-color: var(--white);
}

/* Bottom of the footer: the disclaimer, then the copyright line */
.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.footer-bottom p {
  max-width: none;
  margin: 0 0 0.75rem;
}

.footer-bottom p:last-child {
  margin-bottom: 0;
}

@media (min-width: 40em) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}


/* ===== 17. SMALL HELPERS ===== */
.space-above {
  margin-top: 1.5rem;
}
