/*
  GroundBid design system — public site (2026-09-27).

  Loaded LAST in <head> on every public page except index.html (which carries
  the same system inline). It restyles pages that still have their own older
  inline styles, without touching their markup or scripts:

    1. Tokens   — remaps the legacy palette (--navy, --gold, --green, ...) onto
                  the theme in groundbid-theme.css (navy, electric blue for
                  actions, emerald for verified/success; 2026-10-11). Legacy
                  gold becomes a light blue-gray, so any "gold background +
                  dark text" component stays readable.
    2. Base     — one system font stack, tight heading tracking, calm links,
                  a single accessible focus ring.
    3. Parts    — header, document layout, forms, buttons, cards, footer, the
                  language switcher and the consent banner.

  Rules here change color, type, radius and borders only; they deliberately do
  not change sizes or layout of app pages (dashboard, open bids) so nothing
  reflows. Pre-redesign state: git tag backup/pre-apple-redesign-20260927.
*/

/* ---------- 1. Tokens ----------
   Values live in groundbid-theme.css (and the Design Manager's /theme.css);
   these are only the older names the page styles still use. */
:root{
  --gb-ink:var(--gb-text); --gb-muted:var(--gb-slate); --gb-hairline:var(--gb-border); --gb-fill:var(--gb-bg-alt);
  --gb-accent:var(--gb-primary); --gb-accent-on-dark:#93C5FD;
  --gb-ease:cubic-bezier(.28,.11,.32,1);

  /* Legacy names used throughout the older inline styles */
  --navy:var(--gb-navy); --navy-dark:var(--gb-navy); --navy-deep:var(--gb-navy);
  --green:var(--gb-success-ink); --green-light:var(--gb-success);
  --gold:var(--gb-primary-soft); --gold-light:var(--gb-bg-alt);
  --bg:var(--gb-bg); --card:var(--gb-surface); --border:var(--gb-border);
  --grey:var(--gb-slate); --muted:var(--gb-slate); --ink:var(--gb-text);
}

/* ---------- 2. Base ---------- */
html{-webkit-text-size-adjust:100%;}
body{font-family:var(--gb-font);background:var(--gb-bg);color:var(--gb-ink);letter-spacing:-.01em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}
h1,h2,h3,h4,h5,h6,.logo{font-family:var(--gb-font) !important;letter-spacing:-.022em;color:var(--gb-navy);}
body > header h1,body > header h2,body > header h3,footer h2,footer h3{color:inherit;}
h1{font-weight:700;}
a{color:var(--gb-accent);text-underline-offset:3px;}
::selection{background:var(--gb-primary-soft);}
:focus-visible{outline:2px solid var(--gb-accent);outline-offset:3px;}
[hidden]{display:none !important;}

/* ---------- 3a. Header ----------
   Document pages (header.site, dark logo): light frosted bar, Apple-style.
   App pages (body > header on dashboard/open bids, white logo): navy bar. */
body > header{background:var(--gb-header-bg);color:var(--gb-header-text);}
header.site{position:sticky;top:0;z-index:50;padding:0;background:rgba(251,251,253,.82);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);color:var(--gb-ink);border-bottom:1px solid var(--gb-hairline);}
header.site .wrap{min-height:52px;}
header.site .logo img,body > header .logo img{height:22px !important;width:auto;}
header.site .back{color:var(--gb-muted);font-weight:500;font-size:13px;}
header.site .back:hover{color:var(--gb-ink);}
body > header .tag{color:#A9B4C8;}
body > header nav.top a,nav.roles button{border-color:rgba(255,255,255,.22);}
nav.roles button.active,.role-locked-label{color:var(--gb-ink);}

/* ---------- 3b. Document pages (legal, help, service guides) ---------- */
main{-webkit-font-smoothing:antialiased;}
.wrap > h1:first-child,main > .wrap > h1{font-size:clamp(36px, 5.6vw, 56px);line-height:1.05;letter-spacing:-.035em;margin-bottom:10px;}
main h2{letter-spacing:-.022em;}
.updated{color:var(--gb-muted);}
main p,main li{line-height:1.6;}
.disclaimer{background:var(--gb-bg-alt);border:1px solid var(--gb-hairline);color:var(--gb-ink);border-radius:var(--gb-radius-sm);}

/* ---------- 3c. Forms (visual only — no size changes) ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]),
select,textarea{border-color:var(--gb-hairline);border-radius:var(--gb-radius-sm);background-color:#fff;color:var(--gb-ink);font-family:inherit;transition:border-color .3s var(--gb-ease), box-shadow .3s var(--gb-ease);}
input:not([type=checkbox]):not([type=radio]):focus,select:focus,textarea:focus{outline:none;border-color:var(--gb-accent);box-shadow:0 0 0 3px rgba(37,99,235,.18);}
input[type=checkbox],input[type=radio]{accent-color:var(--gb-primary);}
label{color:var(--gb-ink);}

/* ---------- 3d. Buttons: blue primary pill, outlined secondary pill ---------- */
button.submit,button.primary,.btn-primary,#ask-btn,#gate button,.modal-actions button.primary,#confirm-btn{
  background:var(--gb-primary) !important;color:var(--gb-on-primary) !important;border:1px solid var(--gb-primary) !important;border-radius:var(--gb-radius-button);box-shadow:0 1px 2px rgba(37,99,235,.25);font-weight:600;letter-spacing:-.01em;
  transition:background-color .3s var(--gb-ease), transform .3s var(--gb-ease);}
button.submit:hover,button.primary:hover,.btn-primary:hover,#ask-btn:hover,#gate button:hover,#confirm-btn:hover{background:var(--gb-primary-hover) !important;border-color:var(--gb-primary-hover) !important;}
button.submit:active,button.primary:active,.btn-primary:active,#ask-btn:active{transform:scale(.98);}
button.submit:disabled,button.primary:disabled{opacity:.45;cursor:default;}
button.secondary,.btn-outline,.link-button{border-radius:var(--gb-radius-button);border-color:var(--gb-border-strong);color:var(--gb-navy);background:#fff;}
button.secondary:hover,.btn-outline:hover{border-color:var(--gb-primary);color:var(--gb-primary);}
.btn{border-radius:var(--gb-radius-button);}

/* ---------- 3e. Surfaces: light cards with a subtle shadow ---------- */
.card,.panel,.cat-card,.step,.service,details.faq,.faq{border-color:var(--gb-border);border-radius:var(--gb-radius);box-shadow:var(--gb-shadow);background-color:var(--gb-surface);}
.badge{border-radius:999px;}
details.faq summary::before{color:var(--gb-accent);}
.eyebrow{color:var(--gb-accent);letter-spacing:.02em;}

/* ---------- 3f. Footer ---------- */
footer.site,body > footer{background:var(--gb-footer-bg);color:var(--gb-footer-text);border-top:0;}
footer.site a,body > footer a{color:var(--gb-footer-text) !important;}
footer.site a:hover,body > footer a:hover{color:#fff !important;}

/* ---------- 3g. Language switcher ---------- */
.lang-switcher{border-radius:999px;font-family:inherit;}
header.site .lang-switcher{background:transparent;border:1px solid var(--gb-hairline);color:var(--gb-ink);}

/* ---------- 3h. Consent banner (growthos-telemetry.js injects its own <style>,
   so these selectors are one step more specific to win) ---------- */
html body .gb-privacy-panel{font-family:var(--gb-font);color:var(--gb-ink);border:1px solid var(--gb-hairline);border-radius:var(--gb-radius);box-shadow:0 10px 30px rgba(0,0,0,.08);letter-spacing:-.01em;padding:22px;}
html body .gb-privacy-panel h2{font-family:var(--gb-font);font-size:19px;letter-spacing:-.02em;}
html body .gb-privacy-panel p{color:var(--gb-muted);}
html body .gb-privacy-panel a{color:var(--gb-accent);font-weight:500;}
html body .gb-privacy-actions button,html body .gb-privacy-choice{border-radius:999px;font-weight:500;font-family:var(--gb-font);}
html body .gb-privacy-allow{background:var(--gb-primary);border-color:var(--gb-primary);color:#fff;}
html body .gb-privacy-decline,html body .gb-privacy-choice{background:#fff;border-color:var(--gb-hairline);color:var(--gb-ink);}
html body .gb-privacy-panel :focus-visible,html body .gb-privacy-choice:focus-visible{outline:2px solid var(--gb-accent);}

/* ---------- 4. Polish layer (2026-09-28): remaining old-style details ---------- */

/* Header: logo left, language + back link grouped on the right (some pages
   put the switcher between them, which centred it). */
header.site .wrap{display:flex;align-items:center;justify-content:space-between;gap:16px;}
header.site .wrap > .lang-switcher-mount{margin-left:auto !important;margin-right:0 !important;}
header.site .lang-switcher{height:30px;padding:0 12px;font-size:12px;}

/* Page titles and reading rhythm — document pages only (they use
   header.site); app pages (dashboard, open bids) keep their spacing. */
header.site ~ main{padding-top:clamp(40px, 7vw, 72px);}
header.site ~ main h1{letter-spacing:-.035em;line-height:1.08;}
header.site ~ main > h2,header.site ~ main .wrap > h2{margin-top:clamp(36px, 5vw, 52px);}
header.site ~ main .updated{font-size:14px;}

/* Sign-in / sign-up account-type choice: blue outline when chosen */
.acct-toggle label{border-radius:12px;border-color:var(--gb-border);background:#fff;transition:border-color .3s var(--gb-ease), box-shadow .3s var(--gb-ease);}
.acct-toggle label.checked{background:var(--gb-primary-soft);border-color:var(--gb-primary);box-shadow:inset 0 0 0 1px var(--gb-primary);}

/* Neutral information boxes */
.provider-stat-tile,.ask-a,.checklist,.direct-invitation-detail div{background:var(--gb-bg-alt) !important;border-color:var(--gb-hairline) !important;border-radius:14px;}
.provider-stat-tile:hover{border-color:var(--gb-primary) !important;}

/* Notices and warnings keep an amber meaning, but refined */
.banner,.warnnote,.release-confirmation,.ask-a.escalated,.direct-invite-review{background:#fff8ec !important;border:1px solid #f0d9a6 !important;color:#6f4b00 !important;border-radius:12px;}

/* Dashboard toasts and invitation page */
.toastmsg .tlabel{color:var(--gb-accent-on-dark);}
.direct-invitation-header{background:var(--gb-navy) !important;border-bottom:1px solid rgba(255,255,255,.08) !important;}
.direct-invitation-claim{border-left-color:var(--gb-primary) !important;}
.direct-invitation-page :focus-visible{outline:2px solid var(--gb-accent) !important;}

/* Consent banner: compact frosted card — text left, choices right on wide
   screens; stacked on phones. Minimised "Privacy choices" pill matches. */
html body .gb-privacy-panel{
  max-width:760px;background:rgba(255,255,255,.86);
  -webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);
  box-shadow:0 12px 40px rgba(0,0,0,.10);font-size:13px;line-height:1.45;
}
html body .gb-privacy-panel h2{font-size:15px;font-weight:600;margin:0 0 4px;}
html body .gb-privacy-panel p{margin:0 0 6px;font-size:13px;}
html body .gb-privacy-panel a{font-size:13px;}
html body .gb-privacy-actions{margin-top:12px;}
html body .gb-privacy-actions button{min-height:36px;padding:7px 18px;font-size:13px;}
@media (min-width:700px){
  html body .gb-privacy-panel{display:grid;grid-template-columns:1fr auto;column-gap:24px;align-items:center;}
  html body .gb-privacy-panel > *{grid-column:1;}
  html body .gb-privacy-panel .gb-privacy-actions{grid-column:2;grid-row:1 / span 3;margin-top:0;flex-wrap:nowrap;}
}
html body .gb-privacy-choice{min-height:32px;padding:6px 14px;font-size:12px;background:rgba(255,255,255,.86);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);box-shadow:0 4px 14px rgba(0,0,0,.08);}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{transition-duration:.01ms !important;animation-duration:.01ms !important;}
}

/* ---------- 5. Status colors (2026-10-11): green means verified/success ---------- */
.badge.verified,.badge.ok,.badge.success,.status-verified,.oknote{background:var(--gb-success-soft) !important;color:var(--gb-success-ink) !important;border-color:#A7E3CB !important;}
.badge.pending,.status-pending{background:var(--gb-warning-soft) !important;color:var(--gb-warning-ink) !important;}
.badge.expired,.badge.rejected,.status-expired{background:var(--gb-danger-soft) !important;color:var(--gb-danger-ink) !important;}

/* ---------- 6. Phone touch targets (2026-10-11, modernization Phase 8) ----------
   On phones every form field and button is at least 44px tall, and text
   fields use 16px type so iOS doesn't zoom in on focus. Checkboxes, radios
   and file pickers keep their native size. Header and footer links get a
   taller tap area without changing how they look. */
@media (max-width:640px){
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):not([type=file]):not([type=color]),select,textarea{min-height:44px;font-size:16px;}
  button,.btn,[role="tab"]{min-height:44px;}
  .lang-switcher-mount select{min-height:40px;}
  header a.back,header .back,header a.logo{display:inline-flex;align-items:center;min-height:44px;}
  footer a{display:inline-block;padding:12px 2px;}
}
