/* Shared by every page (base.html loads it before any page stylesheet).
   - IBM Plex Sans, self-hosted: the only @font-face rules on the site.
   - The --th- tokens of the logged-in look (static/css/app.css, DESIGN.md).
   - The "night" look the homepage and the login, sign-up and password reset
     pages share: its colour tokens, the logo mark colours, the page width,
     the buttons, the header and the footer (templates/partials/site_header.html
     and site_footer.html). Classes are prefixed hp-; on the auth pages they sit
     inside body.th-auth (templates/accounts/auth_base.html).
   The homepage's own sections and motion stay in static/css/home.css. */

/* IBM Plex Sans, the one family on every page, self-hosted (SIL Open Font License:
   static/fonts/ibm-plex-sans/OFL.txt): no request to Google blocks the first paint. 600 for
   headings and money, 500 for labels, 400 for text. latin carries the text; latin-ext
   carries the naira sign (U+20A6) and only downloads on a page that shows it. The files
   are Fontsource's own subsets, unmodified. */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-sans/ibm-plex-sans-400-latin.77bc02670657.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-sans/ibm-plex-sans-400-latin-ext.1bc0d8e41d21.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-sans/ibm-plex-sans-500-latin.f7016cd446d2.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-sans/ibm-plex-sans-500-latin-ext.93a0df997e00.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/ibm-plex-sans/ibm-plex-sans-600-latin.196e3cbc5fee.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/ibm-plex-sans/ibm-plex-sans-600-latin-ext.8fccbdf5bf67.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }


:root {
  --hp-ink: #0F1630; --hp-ink-2: #151E40; --hp-ink-3: #0B1126;
  --hp-panel: #161F42; --hp-panel-line: #29346A;
  --hp-on-dark: #FFFFFF; --hp-on-dark-2: #C9D1E3; --hp-on-dark-3: #AEB8D0;
  --hp-paper: #FFFFFF; --hp-paper-2: #F7F8FB;
  --hp-text: #141B2E; --hp-muted: #5B6478; --hp-line: #E3E7EE;
  --hp-blue: #3B82F6; --hp-blue-2: #2563EB; --hp-blue-soft: #93C5FD;
  --hp-teal: #2BC4B4; --hp-teal-2: #0D7D73; --hp-green: #4ADE80; --hp-amber: #F5B454;
  --hp-gutter: clamp(20px, 5vw, 80px);
  --hp-maxw: 1200px;
  --hp-focus: #93C5FD;
  --hp-nav: #111834;
  --hp-brand-teal: #0FB5A6; --hp-mark-teal: #14B8A6;
  /* Fills behind white labels: the main button, the How it works switch and its
     step numbers. White stays at least 4.5:1 everywhere on them (top 4.75:1,
     bottom 5.17:1; the last step's teal 4.76:1 to 5.00:1). Glows derive from the
     bottom colour. */
  --hp-btn-top: #2F6BEB; --hp-btn-bottom: #2563EB;
  --hp-step-teal-top: #0E8174;
}
/* The logged-in look, "The Hold" (DESIGN.md, Colors). The one place these
   colours are set; static/css/app.css uses nothing else. Contrast on the
   surface each is meant for, checked against WCAG AA (4.5:1 text, 3:1 marks). */
:root {
  --th-font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --th-font-display: var(--th-font-body); /* one family: headings differ by weight (600) */

  --th-navy: #15162A;          /* money top blocks, desktop side menu */
  --th-navy-raised: #23243C;   /* boxes inside navy */
  --th-page: #F3F4F6;          /* page background */
  --th-block: #FFFFFF;         /* blocks */
  --th-divider: #ECEEF2;       /* lines between rows */
  --th-border: #E2E4EA;        /* block and bar edges */
  --th-border-strong: #D5D8E0; /* dropdown edge */
  --th-border-control: #868A9E;/* field and outline-button edges: 3.42:1 on white, 3.11:1 on the page */

  --th-text: #15162A;          /* 17.8:1 on white */
  --th-text-2: #626579;        /* secondary: 5.74:1 on white, 5.22:1 on the page */
  --th-text-3: #45485C;        /* tertiary: 9.0:1 on white */
  --th-on-navy: #C9CBDB;       /* 11.1:1 on navy, 9.4:1 on raised */
  --th-on-navy-2: #A5A8C2;     /* 7.6:1 on navy, 6.5:1 on raised */

  --th-teal: #0F766E;          /* done and good news on white: 5.47:1 */
  --th-teal-wash: #E7F3F1;     /* behind teal text: 4.82:1 */
  --th-teal-bright: #2DD4BF;   /* only on navy: 9.56:1 */
  --th-teal-tag: rgba(45, 212, 191, 0.12); /* the Held tag on navy: bright teal 7.63:1 on it */

  --th-blue: #2563EB;          /* the main button and Start a deal: white 5.17:1 */
  --th-blue-press: #1D4ED8;
  --th-blue-wash: #EFF4FE;     /* unread notification */

  --th-amber: #F59E0B;         /* current step on navy: 8.29:1 */
  --th-amber-step: #D97706;    /* current step on white: 3.19:1 */
  --th-amber-text: #92400E;    /* "your turn" words: 7.09:1 on white */
  --th-amber-light: #FCD34D;   /* "your turn" words on navy: 12.3:1 */
  --th-amber-wash: #FEF3C7;    /* behind amber text (payout hold) */

  --th-online: #15803D;        /* the dispute chat's "Online now" dot only; the words carry it */
  --th-red: #B91C1C;           /* only the Problem reported label (5.30:1 on its wash), and Log out */
  --th-red-wash: #FEE2E2;
  --th-refund: #1E40AF;        /* the Refunded label: 7.15:1 on its wash */
  --th-refund-wash: #DBEAFE;

  --th-step-next: #D5D8E0;           /* "not yet" on white (the words carry the state) */
  --th-step-next-on-navy: #3A3C55;   /* "not yet" on navy */
  --th-focus: #2563EB;               /* focus ring on light surfaces: 5.17:1 */
  --th-focus-on-navy: #FFFFFF;       /* focus ring on navy */
  --th-scrim: rgba(21, 22, 42, 0.55);/* behind the bottom panel */
  --th-whatsapp: #25D366; --th-whatsapp-press: #1FBE5A;

  --th-radius-block: 14px;
  --th-radius-btn: 12px;
  --th-radius-label: 6px;
  --th-main-button: 52px;     /* the phone's fixed main button */
  --th-content-max: 1100px;
}
/* Colours for the inline SVGs in home.html (logo mark, escrow lock, final mark). */
.hp-ink-blue { stroke: var(--hp-blue); }
.hp-ink-brand-teal { stroke: var(--hp-brand-teal); }
.hp-fill-brand-teal { fill: var(--hp-brand-teal); }
.hp-ink-mark-teal { stroke: var(--hp-mark-teal); }
.hp-fill-mark-teal { fill: var(--hp-mark-teal); }
.hp-fill-ink { fill: var(--hp-ink); }
.hp-wrap { width: 100%; max-width: calc(var(--hp-maxw) + var(--hp-gutter) * 2); margin: 0 auto; padding-inline: var(--hp-gutter); }

/* Buttons */
.hp-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px;
  text-decoration: none; color: #fff; white-space: nowrap;
}
/* Shape, label and fill shared with the auth pages' main button (.th-auth .btn). */
.hp-btn, .th-auth .btn:not(.btn--quiet) { border-radius: 12px; font-weight: 600; font-size: 16px; }
.hp-btn-p, .th-auth .btn:not(.btn--quiet) {
  background: linear-gradient(180deg, var(--hp-btn-top), var(--hp-btn-bottom));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--hp-btn-bottom) 40%, transparent), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.hp-btn-p:hover, .th-auth .btn:not(.btn--quiet):not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 14px 34px color-mix(in srgb, var(--hp-btn-bottom) 50%, transparent); }
.hp-btn-s { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.2); transition: background .2s ease, border-color .2s ease; }
.hp-btn-s:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.32); }

/* Header */
.hp-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; transition: background .3s ease, box-shadow .3s ease; }
.hp-top.scrolled { background: var(--hp-nav); box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.hp-top .hp-wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.hp-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 18px; min-height: 44px; }
.hp-brand b { color: var(--hp-teal); font-weight: 600; }
.hp-nav { display: flex; align-items: center; gap: 32px; font-size: 15px; font-weight: 500; }
.hp-nav .hp-link { color: #E2E8F5; text-decoration: none; padding: 10px 0; }
.hp-nav .hp-link:hover { color: #fff; }
/* Log out is a POST form; its button reads exactly like the links. */
.hp-logout { display: contents; }
.hp-nav button.hp-link { background: none; border: 0; margin: 0; font: inherit; cursor: pointer; }
.hp-nav .hp-btn { min-height: 44px; padding: 0 20px; font-size: 15px; }

/* Footer (overrides base.html's plain footer rule) */
.hp-foot {
  background: var(--hp-ink-3); border-top: 1px solid #1C2548; color: var(--hp-on-dark-3); font-size: 15px;
  margin: 0; padding: 0;
}
.hp-foot .hp-wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-block: 64px 40px; }
.hp-foot .hp-brand { color: #fff; margin-bottom: 12px; }
.hp-foot p { margin: 0; line-height: 1.6; max-width: 320px; }
/* Support email: footer grey and weight, with the FAQ links' soft underline. */
.hp-foot .hp-mail {
  display: inline-block; margin-top: 14px;
  color: var(--hp-on-dark-3); font-weight: 400;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  text-decoration-color: rgba(174,184,208,.35);  /* a softer --hp-on-dark-3 */
  transition: color .2s ease, text-decoration-color .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .hp-foot .hp-mail:hover { color: var(--hp-teal); text-decoration-color: var(--hp-teal); }
}
.hp-foot h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; color: #fff; }
.hp-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hp-foot ul a { display: inline-block; padding: 6px 0; text-decoration: none; color: var(--hp-on-dark-3); }
.hp-foot ul a:hover { color: #fff; }
.hp-legal { border-top: 1px solid #1C2548; }
.hp-legal .hp-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 22px 28px; font-size: 13px; color: #8C97B3; }

@media (max-width: 860px) {
  .hp-top .hp-wrap { height: 68px; }
  .hp-nav .hp-link, .hp-nav .hp-btn { display: none; }
  /* Logged in, Dashboard and Log out stay visible on phones. */
  .hp-nav .hp-btn.hp-dash { display: inline-flex; }
  .hp-top--user .hp-nav { gap: 8px; }
  .hp-top--user .hp-nav .hp-btn, .hp-top--user .hp-nav .hp-link.hp-login { padding: 0 14px; }
  .hp-nav .hp-link.hp-login {
    display: inline-flex !important; align-items: center; min-height: 44px; padding: 0 18px;
    border: 1px solid rgba(255,255,255,.22); border-radius: 10px; font-weight: 600; text-decoration: none; color: #fff;
  }
  .hp-foot .hp-wrap { grid-template-columns: 1fr 1fr; gap: 28px; padding-block: 48px 28px; }
  .hp-foot .hp-wrap > div:first-child { grid-column: 1 / -1; }
  .hp-legal .hp-wrap { flex-direction: column; gap: 2px; }
}
@media (max-width: 400px) {
  /* Logged in on a small phone: the mark alone, so both buttons fit. The
     link keeps its "Trusthold home" label. */
  .hp-top--user .hp-brand span { display: none; }
}
@media (max-width: 640px) {
  .hp-legal .hp-wrap { gap: 7px; }  /* the two bottom lines, stacked on phones */
}

/* Log in, sign up and password reset (body.th-auth, templates/accounts/auth_base.html).
   Everything below is scoped to body.th-auth, so it can't reach the homepage. */
body.th-auth {
  display: flex; flex-direction: column; min-height: 100vh;
  background: var(--hp-ink) linear-gradient(180deg, var(--hp-ink-2) 0, var(--hp-ink) 640px) no-repeat;  /* the hero's */
}
body.th-auth main { flex: 1 0 auto; }

/* The homepage's header and footer also rely on page-wide rules that stay in
   home.css (body font and colour, a { color: inherit }, the focus ring, text
   wrapping). Scoped copies for the auth pages, at the same low specificity
   (:where adds none), so they match the homepage exactly. */
:where(body.th-auth) .hp-top, :where(body.th-auth) .hp-foot {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased;
}
:where(body.th-auth) .hp-top { color: var(--hp-on-dark); font-size: 16px; }
:where(body.th-auth .hp-top, body.th-auth .hp-foot) a { color: inherit; }
:where(body.th-auth .hp-top, body.th-auth .hp-foot) :focus-visible { outline: 3px solid var(--hp-focus); outline-offset: 3px; border-radius: 6px; }
:where(body.th-auth .hp-foot) h2 { text-wrap: balance; }
:where(body.th-auth .hp-foot) p { text-wrap: pretty; }

/* The form card: white, for field contrast, in the homepage's text colours. */
.th-auth .container { margin: 32px auto 72px; }
.th-auth .card { box-shadow: var(--shadow-float); }
.th-auth .card h2 { color: var(--hp-text); }
.th-auth .card p.subtitle, .th-auth .link-text, .th-auth .form-group label { color: var(--hp-muted); }
.th-auth .form-group input { padding: 14px; }
/* Links: the homepage FAQ links' soft underline (1px, 4px offset, 35%). */
.th-auth .link-text a {
  color: var(--hp-blue-2); font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--hp-blue-2) 35%, transparent);
  transition: text-decoration-color .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .th-auth .link-text a:hover { text-decoration-color: var(--hp-blue-2); }
}
/* The main button takes the homepage's shape and fill (shared rules under
   Buttons above). While a form is sending it's disabled: flat slate, no glow. */
.th-auth .btn:not(.btn--quiet):disabled { background: var(--color-pending-slate); box-shadow: none; transform: none; cursor: progress; }

/* Reduced motion: no lift, no fades on the header, buttons or links. */
@media (prefers-reduced-motion: reduce) {
  .th-auth .hp-top, .th-auth .hp-btn, .th-auth .btn:not(.btn--quiet), .th-auth .hp-foot .hp-mail, .th-auth .link-text a { transition: none; }
  .th-auth .hp-btn-p:hover, .th-auth .btn:not(.btn--quiet):not(:disabled):hover { transform: none; }
}
