/* =============================================================================
   BillGrid public site: foundation and shared components.
   Loads after tokens/bg-tokens.css, so colours, radii and type come from the app's
   own tokens. Page-only styles live in outer/home.css and outer/auth.css.
   Design source: docs/mocks/site/payday.html.
   ============================================================================= */

:root {
  /* marketing-only tokens */
  --site-max: 1240px;
  --site-gutter: clamp(16px, 4vw, 56px);
  --hl: #e8cf8f;                /* pale gold: accents and highlights, never button fills */
  --paper: #faf8f3;
  --line: #ebe5d8;
  --trust: var(--sent-fg);      /* teal, reserved for security and reassurance cues */
  --trust-bg: var(--sent-bg);
  --caption: #766c55;           /* >= 4.5:1 on white, paper and sand (the app's --text-soft is 2.7-3.1:1) */
  /* type scale: every text size on the site comes from here; display headlines use the clamps below */
  --fs-xs: 12px;                /* uppercase labels, timestamps, legal */
  --fs-sm: 14px;                /* secondary only: captions, hints, chips, footer */
  --fs-body: 15px;              /* body copy, UI, buttons, inputs, descriptions */
  --fs-md: 17px;                /* card and list titles */
  --fs-lg: 20px;                /* plan names, screen titles, wordmark */
  --fs-xl: 24px;                /* figures inside product artwork */
  --fs-lead: clamp(17px, 1.3vw, 19px);
  --fs-d2: clamp(32px, 4vw, 56px);
  --fs-d1: clamp(44px, 5.2vw, 78px);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --shadow-card: 0 30px 70px -40px rgba(40, 32, 16, .45), 0 0 0 1px var(--line);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body.site.bg-nav-open { overflow: hidden; }
body.site {
  margin: 0; background: #fff; color: var(--text);
  font-family: var(--font-sans); font-size: var(--fs-body); line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
/* The element reset sits in :where() (zero specificity), so any component class overrides it. */
:where(.site) img { max-width: 100%; height: auto; display: block; }
:where(.site) a { color: inherit; }
:where(.site) :focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
:where(.site) :is(h1, h2, h3, h4) { margin: 0; color: var(--ink); font-family: var(--font-sans); font-weight: 600; letter-spacing: -.03em; line-height: 1.05; }
:where(.site) p { margin: 0; }
:where(.site) button { font: inherit; cursor: pointer; }
:where(.site) [hidden] { display: none !important; }

.wrap { max-width: var(--site-max); margin: 0 auto; padding-inline: var(--site-gutter); }
/* controls that only work with JavaScript (demos): hidden until html.js is set */
html:not(.js) .js-only { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 200; padding: 8px 14px; border-radius: var(--r-md); background: var(--ink); color: #fff; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* serif italic accent inside a sans headline: "Get paid. <em class="accent">Skip the rest.</em>" */
.accent { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; color: var(--gold); }
.kicker { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep); }
.kicker--trust { color: var(--trust); }
.lead { font-size: var(--fs-lead); color: var(--text-muted); }
/* the quieter second half of a headline: "One place for the money side. <span class=subdued>…</span>" */
.subdued { color: var(--caption); }
.checklist { list-style: none; display: grid; gap: 8px; margin: 22px 0 0; padding: 0; font-size: var(--fs-body); }
.checklist li, .plan li { display: flex; gap: 10px; }
.checklist li::before, .plan li::before { content: "\2713"; flex: none; font-weight: 700; color: var(--paid-fg); }
.caption { font-size: var(--fs-sm); color: var(--caption); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--r-md); padding: 10px 18px;
  font-size: var(--fs-body); font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s var(--ease-out);
}
.btn--lg { padding: 14px 24px; font-size: var(--fs-body); border-radius: var(--r-lg); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* warm charcoal, shared with the app (bg-tokens --btn-primary-*): 15:1 with white text */
.btn--primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn--primary:hover { background: var(--btn-primary-hover-bg); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--sand-400); }
.btn--block { width: 100%; }
.btn:active { transform: translateY(1px); }

/* ---------- header ---------- */
.announce-bar { margin: 0; background: var(--ink); color: #e8e1d0; font-size: var(--fs-sm); text-align: center; padding: 9px 16px; }
.announce-bar a { color: var(--hl); font-weight: 600; text-decoration: none; }
.announce-bar a:hover { text-decoration: underline; }
@media (max-width: 640px) { .announce-bar__more { display: none; } }
.site-header { position: sticky; top: 0; z-index: var(--z-sticky); border-bottom: 1px solid transparent; transition: border-color .2s; }
/* the frosted glass lives on a pseudo-element: backdrop-filter on the header itself would make it the
   containing block for the fixed phone drawer, pinning the drawer to the header instead of the viewport */
.site-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.4) blur(14px); }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__bar { display: flex; align-items: center; gap: 28px; height: 68px; }
.brandmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-serif); font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; }
.brandmark__logo { width: 28px; height: 28px; border-radius: 7px; background: var(--gold); color: var(--cream); display: grid; place-items: center; font-size: var(--fs-md); font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.site-nav { display: flex; align-items: center; gap: 26px; flex: 1; }
.site-nav__links { display: flex; gap: 26px; list-style: none; margin: 0 0 0 10px; padding: 0; }
.site-nav__links a { color: var(--text-muted); font-size: var(--fs-body); text-decoration: none; transition: color .15s; }
.site-nav__links a:hover, .site-nav__links a[aria-current="page"] { color: var(--ink); }
.site-nav__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.site-nav__signin { color: var(--text-muted); font-size: var(--fs-body); text-decoration: none; padding: 8px 10px; }
.site-nav__signin:hover { color: var(--ink); }
.site-nav__toggle, .site-nav__close { display: none; border: 0; background: none; padding: 8px; margin-right: -8px; color: var(--ink); }
.site-nav__scrim { display: none; }

@media (max-width: 860px) {
  .site-nav__toggle { display: inline-grid; margin-left: auto; }
  /* the nav becomes a right-hand drawer; BgOverlay.bindNavDrawer (outer/site.js) toggles .show */
  .site-nav {
    position: fixed; inset: 0 0 0 auto; width: min(320px, 86vw); z-index: var(--z-drawer);
    flex-direction: column; align-items: stretch; gap: 20px; padding: 64px 24px 24px;
    background: #fff; box-shadow: -20px 0 60px rgba(40, 32, 16, .2);
    transform: translateX(100%); visibility: hidden; transition: transform .25s var(--ease-out), visibility .25s;
  }
  .site-nav.show { transform: none; visibility: visible; }
  .site-nav__close { display: inline-grid; position: absolute; top: 14px; right: 18px; }
  .site-nav__links { flex-direction: column; gap: 4px; margin: 0; }
  .site-nav__links a { display: block; padding: 10px 0; font-size: var(--fs-md); color: var(--ink); }
  .site-nav__actions { flex-direction: column; align-items: stretch; margin: 12px 0 0; gap: 10px; }
  .site-nav__actions .btn { padding: 13px; }
  .site-nav__signin { text-align: center; border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; color: var(--ink); }
  .site-nav__scrim { position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); background: var(--scrim); opacity: 0; transition: opacity .25s; }
  .site-nav__scrim.show { display: block; opacity: 1; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(72px, 9vw, 120px); }
.section--paper { background: var(--paper); border-block: 1px solid var(--line); }
.section--rule { border-top: 1px solid var(--line); }
.section__head { max-width: 680px; }
.section__head h2 { font-size: var(--fs-d2); line-height: 1.02; margin-top: 10px; }
.section__head .lead { margin-top: 14px; }

/* ---------- email capture (posts to sign-up with the address prefilled) ---------- */
.capture { display: flex; gap: 6px; max-width: 520px; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.capture:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.capture input { flex: 1; min-width: 0; border: 0; background: none; padding: 0 12px; font: inherit; font-size: var(--fs-body); color: var(--ink); outline: none; }
.capture input::placeholder { color: var(--caption); }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; padding: 11px 13px; border-radius: 10px; font-size: var(--fs-sm); }
.alert svg { flex: none; margin-top: 2px; }
.alert a { color: inherit; font-weight: 600; }
.alert--error { background: var(--overdue-bg); color: #7e2f18; }
.alert--ok { background: var(--paid-bg); color: #34491c; }

/* ---------- fields: sign-in, sign-up, contact ---------- */
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field__label { display: flex; width: 100%; justify-content: space-between; align-items: baseline; padding: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.field__label a { font-size: var(--fs-sm); font-weight: 500; color: var(--trust); text-decoration: none; }
.field__label a:hover { text-decoration: underline; }
.field input:not([type="radio"]), .field textarea { width: 100%; padding: 12px 14px; border: 1px solid #d9d1bf; border-radius: 10px; background: #fff; font: inherit; font-size: var(--fs-body); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field :is(input, textarea)::placeholder { color: #a79d85; }
.field :is(input, textarea):hover { border-color: var(--sand-400); }
.field :is(input, textarea):focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(40, 36, 28, .08); }
.field :is(input, textarea)[aria-invalid="true"] { border-color: var(--overdue-fg); box-shadow: 0 0 0 4px rgba(177, 72, 42, .1); }
.field__password { position: relative; }
.field__password input { padding-right: 64px; }
.field__reveal { position: absolute; right: 6px; top: 50%; translate: 0 -50%; padding: 7px 9px; border: 0; border-radius: 7px; background: none; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.field__reveal:hover { background: var(--paper); color: var(--ink); }
.field__hint { font-size: var(--fs-sm); color: var(--text-muted); }
.field__hint--warn { color: #8a5a12; }
.field__hint--bad { color: var(--overdue-fg); }
.field__hint--good { color: var(--paid-fg); }
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }

/* ---------- closing call to action (fragments/site-closing.html) ---------- */
.closing { text-align: center; }
.closing h2 { font-size: clamp(44px, 6vw, 84px); line-height: .98; }
.closing .capture { margin: 28px auto 0; }

/* ---------- toast: the app's "Payment received" alert as a floating card ---------- */
.toast { display: flex; gap: 12px; align-items: flex-start; max-width: 330px; padding: 13px 16px 13px 13px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-card); font-size: var(--fs-sm); color: var(--text); text-align: left; }
.toast b { color: var(--ink); }
.toast small { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--caption); }
.toast__icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--paid-fg); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* ---------- trust cues: small, teal, factual ---------- */
.trustline { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; padding: 0; font-size: var(--fs-sm); color: var(--trust); }
.trustline li { display: inline-flex; align-items: center; gap: 7px; }
.trustline a { display: inline-flex; align-items: center; gap: 7px; color: inherit; text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, var(--trust) 45%, transparent); text-underline-offset: 4px; }
.trustline a:hover { text-decoration-style: solid; text-decoration-color: currentColor; }

/* ---------- plans (home and pricing) ---------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 36px; }
.plan { display: flex; flex-direction: column; padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.plan--featured { border: 2px solid var(--ink); }
.plan h3 { font-size: var(--fs-lg); letter-spacing: -.02em; }
.plan__price { margin-top: 10px; font-size: 52px; font-weight: 600; letter-spacing: -.04em; color: var(--ink); line-height: 1.1; }
.plan__price small { font-size: var(--fs-body); font-weight: 500; letter-spacing: 0; color: var(--caption); }
.plan__for { font-size: var(--fs-body); color: var(--text-muted); }
.plan ul { list-style: none; display: grid; gap: 8px; margin: 18px 0 24px; padding: 0; font-size: var(--fs-body); }
.plan .btn { margin-top: auto; }
.plan__note { margin-top: 10px; text-align: center; font-size: var(--fs-sm); color: var(--caption); }
@media (max-width: 760px) { .plans { grid-template-columns: minmax(0, 1fr); } }

/* ---------- security facts (home and features) ---------- */
.security-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 40px; border-top: 1px solid var(--line); }
.security-grid > div { padding: 24px 24px 0 0; }
.security-grid > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.security-grid__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--trust-bg); color: var(--trust); }
.security-grid h3 { margin-top: 14px; font-size: var(--fs-body); letter-spacing: -.01em; }
.security-grid p { margin-top: 6px; font-size: var(--fs-body); line-height: 1.55; color: var(--text-muted); }
.security-foot { margin-top: 34px; font-size: var(--fs-sm); color: var(--text-muted); }
.security-foot a { color: var(--trust); text-underline-offset: 3px; }
@media (max-width: 900px) { .security-grid { grid-template-columns: 1fr 1fr; row-gap: 24px; } .security-grid > div:nth-child(3) { padding-left: 0; border-left: 0; } }
@media (max-width: 520px) { .security-grid { grid-template-columns: minmax(0, 1fr); } .security-grid > div + div { padding-left: 0; border-left: 0; } }

/* ---------- footer ---------- */
/* Light-on-dark values are the app's dark-theme sand ramp (bg-tokens.css [data-theme="dark"]). */
.site-footer { background: var(--sand-900); color: #a99f84; font-size: var(--fs-body); }
.site-footer a { color: #e3dac7; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer__cols, .updates__inner { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); column-gap: 40px; }
.site-footer__cols { padding-block: 64px 0; }
.site-footer__tagline { margin-top: 16px; max-width: 22em; color: #8d8268; }
.site-footer__made { margin-top: 10px; max-width: 24em; font-size: var(--fs-sm); color: #8d8268; }
.site-footer .brandmark { color: var(--cream); }
.site-footer h2 { margin: 0 0 14px; font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #8d8268; }
.site-footer ul { list-style: none; display: grid; gap: 9px; margin: 0; padding: 0; }
.site-footer__fine { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 56px; padding-block: 22px 32px; border-top: 1px solid #392f1f; font-size: var(--fs-sm); color: #a99f84; }
.site-footer__secure { display: inline-flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.site-footer__secure span { display: inline-flex; gap: 6px; align-items: center; }

/* newsletter form (fragments/newsletter-form.html): the email capture on light pages, inverted on the band */
.newsletter-form { display: flex; gap: 6px; max-width: 520px; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.newsletter-form:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.newsletter-form input[type="email"] { flex: 1; min-width: 0; border: 0; background: none; padding: 0 12px; font: inherit; font-size: var(--fs-body); color: var(--ink); outline: none; }
.newsletter-form input::placeholder { color: var(--caption); }

/* product-updates band */
.updates { background: var(--sand-800); color: #cabfa6; }
.updates__inner { align-items: center; row-gap: 20px; padding-block: 40px; }
.updates__copy { grid-column: 1 / span 2; display: flex; gap: 16px; align-items: flex-start; }
.updates__icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(232, 207, 143, .1); box-shadow: inset 0 0 0 1px rgba(232, 207, 143, .22); color: var(--hl); }
.updates__kicker { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: #a99f84; }
.site-footer .updates__copy h2 { margin: 4px 0 0; font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.015em; text-transform: none; color: #faf6ea; }
.updates__copy h2 .accent { color: var(--hl); }
.updates__copy p:not(.updates__kicker) { margin-top: 4px; font-size: var(--fs-sm); }
.updates__signup { grid-column: 3 / span 2; }
.updates__note { margin: 10px 0 0 4px; font-size: var(--fs-xs); color: #a99f84; }
.updates .newsletter-form { max-width: none; padding: 5px; border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); }
.updates .newsletter-form:focus-within { border-color: var(--hl); box-shadow: none; }
.updates .newsletter-form input[type="email"] { padding: 0 10px; color: #faf6ea; }
.updates .newsletter-form input::placeholder { color: #a99f84; }
/* on the dark band the charcoal inverts to cream */
.updates .newsletter-form .btn { background: #faf6ea; color: var(--ink); }
.updates .newsletter-form .btn:hover { background: #fff; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 860px) {
  .site-footer__cols { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .site-footer__cols > :first-child { grid-column: 1 / -1; }
  .updates__inner { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .updates__copy, .updates__signup { grid-column: 1; }
}

/* ---------- scroll reveal (html.js is set in <head>; without JS everything is visible) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal[data-delay="1"] { transition-delay: .08s; }
.js .reveal[data-delay="2"] { transition-delay: .16s; }
.js .reveal[data-delay="3"] { transition-delay: .24s; }

/* iOS zooms into any field under 16px; keep the scale on desktop, stop the zoom on touch */
@media (pointer: coarse) { body.site :is(input, textarea, select) { font-size: 16px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
