/* ═══════════════════════════════════════════════════════════════════════════
   IDEX — design system
   ───────────────────────────────────────────────────────────────────────────
   One stylesheet for the marketing site, the customer dashboard and the admin
   panel. That is the point: a component defined once cannot drift, so every
   page is the same product.

   The palette arrives as custom properties from includes/brand.php, inlined in
   <head>. Nothing below hard-codes a brand colour — every value here is
   var(--navy), var(--blue), var(--white) or one of those at an opacity.

   Written by hand rather than generated. A utility framework would have meant
   a build step, a CDN dependency in a strict CSP, or a runtime compiler in the
   browser; a fintech front page cannot afford any of the three.

   Order: reset → typography → layout → components → shells → pages → utilities
   → responsive → motion/print.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset ───────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor targets clear the fixed header instead of hiding under it. */
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Nothing on this site may scroll the page sideways at any width. */
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.25rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

/* A visible focus ring on everything reachable by keyboard. Removing it is a
   accessibility regression, not a design decision. */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Screen-reader-only, but focusable — used by the skip link. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy); color: var(--white);
  padding: .75rem 1.25rem; border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus { left: 0; text-decoration: none; }

/* ── Typography scale ────────────────────────────────────────────────────── */

.h-display { font-size: clamp(2rem, 5.2vw, 3.25rem); line-height: 1.12; letter-spacing: -.03em; }
.h-1       { font-size: clamp(1.625rem, 3.6vw, 2.25rem); }
.h-2       { font-size: clamp(1.375rem, 2.6vw, 1.75rem); }
.h-3       { font-size: 1.1875rem; }
.h-4       { font-size: 1rem; }

.lead      { font-size: clamp(1rem, 1.5vw, 1.125rem); color: var(--text-muted); line-height: 1.7; }
.text-sm   { font-size: .875rem; }
.text-xs   { font-size: .8125rem; }
.muted     { color: var(--text-muted); }
.faint     { color: var(--text-faint); }
.mono      { font-family: var(--font-mono); font-size: .875em; }

.eyebrow {
  display: inline-block;
  font-size: .75rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--blue);
  margin-bottom: .75rem;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 1.25rem; }
.container--narrow { max-width: 760px; }
.container--wide   { max-width: 1400px; }

.section    { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--sm{ padding-block: clamp(2rem, 4vw, 3rem); }
.section--sunken { background: var(--surface-sunken); }
.section--navy   { background: var(--navy); color: rgba(255,255,255,.82); }
.section--navy h1, .section--navy h2, .section--navy h3 { color: var(--white); }

.section-head { max-width: 42rem; margin-bottom: 2.5rem; }
.section-head--center { margin-inline: auto; text-align: center; }

.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stack   { display: flex; flex-direction: column; gap: 1rem; }
.stack--sm { gap: .5rem; }
.row     { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end     { justify-content: flex-end; }
.row--tight   { gap: .375rem; }

/* ── Brand mark ──────────────────────────────────────────────────────────── */

.brand-logo { display: inline-flex; align-items: center; gap: .5rem; color: inherit; }
.brand-logo__mark { width: 28px; height: 28px; flex: 0 0 28px; }
.brand-logo__word {
  font-size: 1.25rem; font-weight: 700; letter-spacing: -.03em; color: inherit;
}
.brand-logo--lg .brand-logo__mark { width: 36px; height: 36px; flex-basis: 36px; }
.brand-logo--lg .brand-logo__word { font-size: 1.5rem; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6875rem 1.25rem;
  font-size: .9375rem; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent; border-radius: var(--r-md);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  /* 44px minimum target: this product is used on phones in the field. */
  min-height: 44px;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn--primary   { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn--primary:hover:not(:disabled) { background: #0e2a4d; border-color: #0e2a4d; }

.btn--accent    { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn--accent:hover:not(:disabled) { background: #0f5ed4; border-color: #0f5ed4; }

.btn--secondary { background: var(--white); color: var(--navy); border-color: var(--border-strong); }
.btn--secondary:hover:not(:disabled) { border-color: var(--navy); background: var(--surface-sunken); }

.btn--ghost     { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn--ghost:hover:not(:disabled) { background: var(--surface-raised); color: var(--text); }

.btn--danger    { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: #b8241a; border-color: #b8241a; }

.btn--danger-outline { background: var(--white); color: var(--danger); border-color: rgba(217,45,32,.35); }
.btn--danger-outline:hover:not(:disabled) { background: var(--danger-wash); }

.btn--sm  { padding: .4375rem .8125rem; font-size: .8125rem; min-height: 36px; }
.btn--lg  { padding: .875rem 1.75rem; font-size: 1rem; min-height: 52px; }
.btn--block { width: 100%; }

.btn__icon { width: 18px; height: 18px; flex: 0 0 18px; }

/* On the navy header the secondary button inverts, keeping one shape language. */
.on-navy .btn--secondary {
  background: transparent; color: var(--white); border-color: rgba(255,255,255,.28);
}
.on-navy .btn--secondary:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); }

/* ── Cards ───────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
}
.card--flush   { padding: 0; overflow: hidden; }
.card--sunken  { background: var(--surface-sunken); }
.card--raised  { box-shadow: var(--shadow-md); }
.card--accent  { border-color: var(--blue-ring); }

.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.125rem 1.5rem; border-bottom: 1px solid var(--border);
}
.card__title { font-size: 1rem; font-weight: 600; margin: 0; }
.card__body  { padding: 1.5rem; }
.card__foot  { padding: 1.125rem 1.5rem; border-top: 1px solid var(--border); background: var(--surface-sunken); }

/* A card that is a link — used for services and quick actions. */
.card-link { display: block; color: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
.card-link:hover { text-decoration: none; border-color: var(--blue-ring); box-shadow: var(--shadow-sm); }

/* ── Icon tiles ──────────────────────────────────────────────────────────── */

.icon-tile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--blue-wash); color: var(--blue); flex: 0 0 44px;
}
.icon-tile--navy  { background: rgba(11,31,58,.06); color: var(--navy); }
.icon-tile--lg    { width: 52px; height: 52px; flex-basis: 52px; }
.icon-tile svg    { width: 22px; height: 22px; }
.icon-tile--lg svg{ width: 26px; height: 26px; }

.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.icon--sm { width: 16px; height: 16px; }

/* ── Badges ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .1875rem .5625rem;
  font-size: .75rem; font-weight: 600; line-height: 1.5;
  border-radius: var(--r-full); white-space: nowrap;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: 0 0 6px;
}
.badge--plain::before { display: none; }

/* Four tones only, and each maps to a state a customer must not misread.
   Success is the brand blue, not a new green — the palette stays at three. */
.badge--success { background: var(--blue-wash);   color: var(--blue); }
.badge--neutral { background: var(--surface-raised); color: var(--text-muted); }
.badge--warning { background: rgba(11,31,58,.07); color: var(--navy); }
.badge--danger  { background: var(--danger-wash); color: var(--danger); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */

.alert {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .875rem 1rem;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--r-md);
  font-size: .9375rem; line-height: 1.6;
  background: var(--surface-sunken);
}
.alert__icon { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; }
.alert__body { min-width: 0; }
.alert__title { font-weight: 600; margin: 0 0 .125rem; }

.alert--success { border-left-color: var(--blue);   background: var(--blue-wash);   color: var(--navy); }
.alert--info    { border-left-color: var(--blue);   background: var(--blue-wash);   color: var(--navy); }
.alert--warning { border-left-color: var(--navy);   background: var(--surface-raised); }
.alert--error,
.alert--danger  { border-left-color: var(--danger); background: var(--danger-wash); color: #8a1c14; }

/* ── Forms ───────────────────────────────────────────────────────────────── */

.field { margin-bottom: 1.125rem; }
.field:last-child { margin-bottom: 0; }

.label {
  display: block; margin-bottom: .375rem;
  font-size: .875rem; font-weight: 600; color: var(--text);
}
.label__optional { font-weight: 400; color: var(--text-faint); }

.input, .select, .textarea {
  display: block; width: 100%;
  padding: .6875rem .875rem;
  /* 16px on mobile: anything smaller makes iOS Safari zoom on focus, which
     throws the whole layout sideways mid-form. */
  font-size: 1rem;
  color: var(--text); background: var(--white);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  transition: border-color .15s ease, box-shadow .15s ease;
  min-height: 46px;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-ring);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--surface-sunken); color: var(--text-faint); cursor: not-allowed;
}

.input--error, .select--error, .textarea--error { border-color: var(--danger); }
.input--error:focus { box-shadow: 0 0 0 3px rgba(217,45,32,.2); }

.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B1F3A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 18px;
  padding-right: 2.5rem;
}

.input--mono { font-family: var(--font-mono); letter-spacing: .04em; }

.help  { margin-top: .375rem; font-size: .8125rem; color: var(--text-muted); line-height: 1.5; }
.error { margin-top: .375rem; font-size: .8125rem; color: var(--danger); font-weight: 500; }

/* Input with a leading unit, e.g. the naira sign on a funding amount. */
.input-group { display: flex; align-items: stretch; }
.input-group__addon {
  display: inline-flex; align-items: center;
  padding: 0 .875rem;
  background: var(--surface-sunken);
  border: 1px solid var(--border-strong); border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
  font-weight: 600; color: var(--text-muted);
}
.input-group .input { border-radius: 0 var(--r-md) var(--r-md) 0; }

/* Checkboxes and radios — custom, because the native control cannot be
   coloured consistently across browsers. */
.check {
  display: flex; align-items: flex-start; gap: .625rem;
  font-size: .9375rem; line-height: 1.55; cursor: pointer;
}
.check input[type="checkbox"], .check input[type="radio"] {
  appearance: none; margin: 0;
  width: 20px; height: 20px; flex: 0 0 20px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--white); cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
  position: relative; top: 1px;
}
.check input[type="radio"] { border-radius: 50%; }

.check input:checked {
  background: var(--blue); border-color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-9'/%3E%3C/svg%3E");
  background-size: 14px; background-position: center; background-repeat: no-repeat;
}
.check input[type="radio"]:checked {
  background-image: none;
  box-shadow: inset 0 0 0 4px var(--white);
}
.check input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* A radio rendered as a selectable card — account type, funding amount. */
.choice {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .875rem 1rem;
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
.choice:hover { border-color: var(--blue-ring); }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-wash); }
.choice__title { font-weight: 600; font-size: .9375rem; }
.choice__desc  { font-size: .8125rem; color: var(--text-muted); }

/* Password strength meter. Four segments, filled left to right. */
.strength { display: flex; gap: 4px; margin-top: .5rem; }
.strength__bar {
  height: 4px; flex: 1; border-radius: var(--r-full); background: var(--surface-raised);
  transition: background-color .2s ease;
}
.strength__bar.is-on   { background: var(--blue); }
.strength__bar.is-weak { background: var(--danger); }

/* ── Tables ──────────────────────────────────────────────────────────────── */

/* Every table lives in one of these. Wide data must scroll inside its own
   box — never push the page sideways. */
.table-wrap {
  width: 100%; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface);
}
.table-wrap .table { border: 0; border-radius: 0; }

.table { width: 100%; border-collapse: collapse; font-size: .875rem; }

.table th {
  text-align: left; font-weight: 600; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint);
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  background: var(--surface-sunken); white-space: nowrap;
}
.table td {
  padding: .875rem 1rem; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-sunken); }

.table__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table__ref { font-family: var(--font-mono); font-size: .8125rem; white-space: nowrap; }
.table__actions { text-align: right; white-space: nowrap; }

/* ── Empty state ─────────────────────────────────────────────────────────── */

.empty { text-align: center; padding: 3rem 1.5rem; }
.empty__icon {
  width: 52px; height: 52px; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface-raised); color: var(--text-faint);
}
.empty__icon svg { width: 24px; height: 24px; }
.empty__title { font-size: 1rem; font-weight: 600; margin-bottom: .25rem; }
.empty__text  { color: var(--text-muted); font-size: .9375rem; max-width: 26rem; margin: 0 auto 1.25rem; }

/* ── Pagination ──────────────────────────────────────────────────────────── */

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; flex-wrap: wrap; }
.pagination__info { font-size: .8125rem; color: var(--text-muted); }
.pagination__links { display: flex; gap: .25rem; flex-wrap: wrap; }
.pagination__link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 .625rem;
  font-size: .875rem; font-weight: 500; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
}
.pagination__link:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); }
.pagination__link.is-active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.pagination__link.is-disabled { opacity: .45; pointer-events: none; }

/* ── Stat cards ──────────────────────────────────────────────────────────── */

.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.25rem;
}
.stat__label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8125rem; font-weight: 500; color: var(--text-muted); margin-bottom: .5rem;
}
.stat__value {
  font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat__meta { margin-top: .375rem; font-size: .8125rem; color: var(--text-faint); }

/* The wallet card is the one deliberately navy surface in the dashboard —
   it is the number customers look for first. */
.stat--navy { background: var(--navy); border-color: var(--navy); color: var(--white); }
.stat--navy .stat__label { color: rgba(255,255,255,.7); }
.stat--navy .stat__meta  { color: rgba(255,255,255,.6); }

/* ── Code blocks ─────────────────────────────────────────────────────────── */

.code {
  position: relative;
  background: var(--navy); color: rgba(255,255,255,.9);
  border-radius: var(--r-lg); overflow: hidden;
}
.code__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .625rem .875rem .625rem 1rem;
  background: rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.code__lang {
  font-size: .75rem; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: rgba(255,255,255,.55);
}
.code__copy {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .3125rem .625rem;
  font-size: .75rem; font-weight: 600;
  color: rgba(255,255,255,.8); background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-sm);
  cursor: pointer; transition: background-color .15s ease;
}
.code__copy:hover { background: rgba(255,255,255,.16); }
.code__copy.is-done { color: var(--white); background: var(--blue); border-color: var(--blue); }

.code pre {
  margin: 0; padding: 1rem 1.125rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  font-family: var(--font-mono); font-size: .8125rem; line-height: 1.7;
  tab-size: 2;
}
.code code { font-family: inherit; }

/* Syntax highlighting. Three colours on navy, all derived from the palette:
   blue for keys and keywords, white for values, translucent for comments. */
.tok-key     { color: #6BA5FF; }
.tok-str     { color: #FFFFFF; }
.tok-num     { color: #9CC4FF; }
.tok-comment { color: rgba(255,255,255,.42); font-style: italic; }
.tok-punc    { color: rgba(255,255,255,.55); }

/* Inline code inside prose. */
:not(pre) > code {
  font-family: var(--font-mono); font-size: .875em;
  padding: .125em .375em; border-radius: var(--r-sm);
  background: var(--surface-raised); color: var(--navy);
  word-break: break-word;
}

/* ── Copy-to-clipboard field (API keys, references) ──────────────────────── */

.copyfield { display: flex; align-items: stretch; gap: 0; }
.copyfield__value {
  flex: 1; min-width: 0;
  padding: .625rem .875rem;
  font-family: var(--font-mono); font-size: .8125rem;
  background: var(--surface-sunken);
  border: 1px solid var(--border-strong); border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
  overflow-x: auto; white-space: nowrap;
  display: flex; align-items: center;
}
.copyfield__btn {
  border-radius: 0 var(--r-md) var(--r-md) 0;
  border: 1px solid var(--border-strong);
  background: var(--white); color: var(--text-muted);
  padding: 0 .875rem; cursor: pointer; font-size: .8125rem; font-weight: 600;
}
.copyfield__btn:hover { background: var(--surface-sunken); color: var(--text); }
.copyfield__btn.is-done { color: var(--blue); }

/* ── Definition list, used by every result and detail panel ──────────────── */

.dl { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; }
.dl__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .75rem 0; border-bottom: 1px solid var(--border);
}
.dl__row:last-child { border-bottom: 0; }
.dl__key { font-size: .875rem; color: var(--text-muted); flex: 0 0 auto; }
.dl__val { font-size: .9375rem; font-weight: 500; text-align: right; word-break: break-word; min-width: 0; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */

.tabs {
  display: flex; gap: .25rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border); margin-bottom: 1.5rem;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: .75rem 1rem; font-size: .9375rem; font-weight: 500;
  color: var(--text-muted); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

/* ── Accordion (FAQ) ─────────────────────────────────────────────────────── */

.accordion { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.accordion__item + .accordion__item { border-top: 1px solid var(--border); }
.accordion__item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.125rem 1.25rem; cursor: pointer; font-weight: 600; font-size: .9375rem;
  list-style: none;
}
.accordion__item summary::-webkit-details-marker { display: none; }
.accordion__item summary::after {
  content: ""; width: 18px; height: 18px; flex: 0 0 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B1F3A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .18s ease; opacity: .6;
}
.accordion__item[open] summary::after { transform: rotate(180deg); }
.accordion__item summary:hover { background: var(--surface-sunken); }
.accordion__body { padding: 0 1.25rem 1.25rem; color: var(--text-muted); font-size: .9375rem; line-height: 1.7; }

/* ── Modal ───────────────────────────────────────────────────────────────── */

.modal { border: 0; padding: 0; background: transparent; max-width: min(30rem, calc(100vw - 2rem)); width: 100%; }
.modal::backdrop { background: rgba(11,31,58,.55); backdrop-filter: blur(2px); }
.modal__panel {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal__head { padding: 1.25rem 1.5rem 0; }
.modal__title { font-size: 1.125rem; margin-bottom: .375rem; }
.modal__body { padding: .75rem 1.5rem 1.25rem; color: var(--text-muted); font-size: .9375rem; }
.modal__foot { display: flex; gap: .625rem; justify-content: flex-end; padding: 1rem 1.5rem; background: var(--surface-sunken); border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════════════════════
   PUBLIC SHELL — header, nav, footer
   ═══════════════════════════════════════════════════════════════════════════ */

.site-header {
  position: sticky; top: 0; z-index: 90;
  height: var(--header-h);
  background: var(--navy); color: var(--white);
}
.site-header__inner {
  height: 100%; display: flex; align-items: center; gap: 1.5rem;
}
.site-header .brand-logo { color: var(--white); }
.site-header .brand-logo:hover { text-decoration: none; }

.nav { display: none; align-items: center; gap: .25rem; margin-left: auto; }
.nav__link {
  padding: .5rem .75rem; border-radius: var(--r-md);
  font-size: .9375rem; font-weight: 500; color: rgba(255,255,255,.78);
}
.nav__link:hover { color: var(--white); background: rgba(255,255,255,.09); text-decoration: none; }
.nav__link.is-active { color: var(--white); background: rgba(255,255,255,.13); font-weight: 600; }

.nav-actions { display: none; align-items: center; gap: .625rem; margin-left: .75rem; }

.nav-toggle {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: transparent; border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--r-md); color: var(--white); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle__close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__open  { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: block; }

/* The mobile drawer. Hidden by default; the toggle sets [data-open]. */
.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0;
  background: var(--navy); color: var(--white);
  padding: 1.25rem; z-index: 89;
  overflow-y: auto;
  display: none;
}
.mobile-nav[data-open="true"] { display: block; }
.mobile-nav__link {
  display: block; padding: .875rem .25rem;
  font-size: 1.0625rem; font-weight: 500; color: rgba(255,255,255,.85);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.mobile-nav__link:hover, .mobile-nav__link.is-active { color: var(--white); text-decoration: none; }
.mobile-nav__actions { display: grid; gap: .625rem; margin-top: 1.5rem; }

/* Body cannot scroll behind an open drawer. */
body.is-locked { overflow: hidden; }

/* Footer */

.site-footer { background: var(--navy); color: rgba(255,255,255,.65); padding-block: 3rem 1.5rem; }
.site-footer a { color: rgba(255,255,255,.72); }
.site-footer a:hover { color: var(--white); }
.site-footer .brand-logo { color: var(--white); margin-bottom: .875rem; }

.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; margin-bottom: 2.5rem; }
.footer-col__title {
  font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255,255,255,.5); margin-bottom: .875rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.footer-col a { font-size: .9375rem; text-decoration: none; }

.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.12);
  font-size: .8125rem;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   HOME / MARKETING
   ═══════════════════════════════════════════════════════════════════════════ */

.hero { background: var(--navy); color: rgba(255,255,255,.8); padding-block: clamp(3rem, 8vw, 6rem); }
.hero h1 { color: var(--white); margin-bottom: 1rem; }
.hero__lead { font-size: clamp(1rem, 1.8vw, 1.1875rem); line-height: 1.7; max-width: 34rem; margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2.5rem; }
.hero__note { font-size: .8125rem; color: rgba(255,255,255,.55); }

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

/* The API sample panel beside the hero copy. */
.hero-panel {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.hero-panel__head {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: .8125rem; color: rgba(255,255,255,.6); font-family: var(--font-mono);
}
.hero-panel__dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.25); }
.hero-panel pre {
  margin: 0; padding: 1rem; overflow-x: auto;
  font-family: var(--font-mono); font-size: .78125rem; line-height: 1.75;
}

/* Statistics strip */
.stats-strip { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, 1fr); }
.stats-strip__item { text-align: center; }
.stats-strip__value { font-size: clamp(1.5rem, 3.5vw, 2.125rem); font-weight: 700; letter-spacing: -.03em; }
.stats-strip__label { font-size: .8125rem; color: var(--text-muted); margin-top: .25rem; }
.section--navy .stats-strip__label { color: rgba(255,255,255,.6); }

/* Feature / step cards */
.feature { display: flex; flex-direction: column; gap: .875rem; }
.feature__title { font-size: 1.0625rem; font-weight: 600; margin: 0; }
.feature__text  { font-size: .9375rem; color: var(--text-muted); line-height: 1.7; margin: 0; }

.step { position: relative; padding-left: 3.25rem; }
.step__num {
  position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy); color: var(--white); font-weight: 700; font-size: .9375rem;
}

/* Pricing preview / table */
.price-card { display: flex; flex-direction: column; height: 100%; }
.price-card__amount {
  font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.price-card__unit { font-size: .875rem; font-weight: 500; color: var(--text-muted); }
.price-card__list { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: .625rem; flex: 1; }
.price-card__list li { display: flex; gap: .5rem; align-items: flex-start; font-size: .9375rem; }
.price-card__list svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--blue); margin-top: 2px; }
.price-card.is-featured { border-color: var(--navy); box-shadow: var(--shadow-md); }

/* CTA band */
.cta-band { background: var(--navy); color: rgba(255,255,255,.78); border-radius: var(--r-lg); padding: clamp(2rem, 5vw, 3rem); text-align: center; }
.cta-band h2 { color: var(--white); }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: 1.75rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════════════════════════ */

.auth {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr;
  background: var(--surface);
}
.auth__aside { display: none; background: var(--navy); color: rgba(255,255,255,.78); padding: 3rem; }
.auth__aside .brand-logo { color: var(--white); }
.auth__main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem 3rem; }
.auth__panel { width: 100%; max-width: 26rem; }
.auth__head { margin-bottom: 1.75rem; }
.auth__head h1 { font-size: 1.5rem; margin-bottom: .375rem; }
.auth__foot { margin-top: 1.5rem; text-align: center; font-size: .9375rem; color: var(--text-muted); }

.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.125rem; }
.auth-points li { display: flex; gap: .75rem; align-items: flex-start; font-size: .9375rem; line-height: 1.6; }
.auth-points svg { width: 20px; height: 20px; flex: 0 0 20px; color: rgba(255,255,255,.85); margin-top: 1px; }

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD SHELL
   ═══════════════════════════════════════════════════════════════════════════ */

.app { min-height: 100vh; background: var(--surface-sunken); }

.app-topbar {
  position: sticky; top: 0; z-index: 80;
  height: var(--header-h);
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; gap: 1rem;
  padding-inline: 1rem;
}
.app-topbar .brand-logo { color: var(--white); }

.app-topbar__spacer { margin-left: auto; }

.app-topbar__btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: transparent; border: 0; color: rgba(255,255,255,.85); cursor: pointer;
}
.app-topbar__btn:hover { background: rgba(255,255,255,.1); color: var(--white); text-decoration: none; }
.app-topbar__btn svg { width: 20px; height: 20px; }

.app-topbar__dot {
  position: absolute; top: 7px; right: 8px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-full); background: var(--danger); color: var(--white);
  font-size: .625rem; font-weight: 700; line-height: 16px; text-align: center;
}

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue); color: var(--white);
  font-size: .8125rem; font-weight: 700; letter-spacing: .02em;
  flex: 0 0 36px;
}
.avatar--lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.125rem; }
.avatar--muted { background: var(--surface-raised); color: var(--text-muted); }

.app-shell { display: flex; align-items: flex-start; }

.app-sidebar {
  display: none;
  position: sticky; top: var(--header-h);
  width: 248px; flex: 0 0 248px;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem .875rem;
}

.side-group + .side-group { margin-top: 1.5rem; }
.side-group__title {
  font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint); padding: 0 .625rem; margin-bottom: .5rem;
}
.side-link {
  display: flex; align-items: center; gap: .625rem;
  padding: .5625rem .625rem; border-radius: var(--r-md);
  font-size: .9375rem; font-weight: 500; color: var(--text-muted);
}
.side-link:hover { background: var(--surface-sunken); color: var(--text); text-decoration: none; }
.side-link.is-active { background: var(--blue-wash); color: var(--blue); font-weight: 600; }
.side-link svg { width: 19px; height: 19px; flex: 0 0 19px; }
.side-link__badge {
  margin-left: auto; font-size: .6875rem; font-weight: 700;
  background: var(--surface-raised); color: var(--text-muted);
  padding: .0625rem .375rem; border-radius: var(--r-full);
}

.app-main { flex: 1; min-width: 0; padding: 1.25rem 1rem 5.5rem; }

.page-head { margin-bottom: 1.5rem; }
.page-head__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.375rem; margin-bottom: .25rem; }
.page-head__sub { font-size: .9375rem; color: var(--text-muted); margin: 0; }

.breadcrumb { display: flex; align-items: center; gap: .375rem; font-size: .8125rem; color: var(--text-faint); margin-bottom: .625rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb__sep { opacity: .5; }

/* Bottom navigation — phones only. The five things a customer does most. */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 85;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav__link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: .5rem .25rem; min-height: 56px;
  font-size: .6875rem; font-weight: 500; color: var(--text-faint);
}
.bottom-nav__link:hover { text-decoration: none; }
.bottom-nav__link.is-active { color: var(--blue); }
.bottom-nav__link svg { width: 21px; height: 21px; }

/* Quick actions on the dashboard home. */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.quick {
  display: flex; flex-direction: column; gap: .625rem;
  padding: 1rem; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.quick:hover { text-decoration: none; border-color: var(--blue-ring); box-shadow: var(--shadow-sm); }
.quick__label { font-size: .875rem; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN SHELL
   Same components, one deliberate difference: the sidebar is navy, so an
   administrator can never mistake which side of the product they are on.
   ═══════════════════════════════════════════════════════════════════════════ */

.app--admin .app-sidebar {
  background: var(--navy); border-right-color: rgba(255,255,255,.08);
}
.app--admin .side-group__title { color: rgba(255,255,255,.4); }
.app--admin .side-link { color: rgba(255,255,255,.72); }
.app--admin .side-link:hover { background: rgba(255,255,255,.08); color: var(--white); }
.app--admin .side-link.is-active { background: rgba(255,255,255,.14); color: var(--white); }
.app--admin .side-link__badge { background: rgba(255,255,255,.16); color: var(--white); }

.admin-tag {
  display: inline-flex; align-items: center; gap: .3125rem;
  padding: .1875rem .5rem; border-radius: var(--r-sm);
  background: rgba(255,255,255,.14); color: var(--white);
  font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DOCUMENTATION
   ═══════════════════════════════════════════════════════════════════════════ */

.docs { display: flex; align-items: flex-start; gap: 2rem; }

.docs-nav {
  display: none;
  position: sticky; top: calc(var(--header-h) + 1.5rem);
  width: 230px; flex: 0 0 230px;
  max-height: calc(100vh - var(--header-h) - 3rem); overflow-y: auto;
}
.docs-nav__group + .docs-nav__group { margin-top: 1.25rem; }
.docs-nav__title {
  font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: .5rem;
}
.docs-nav__link {
  display: block; padding: .375rem .625rem; border-radius: var(--r-sm);
  font-size: .875rem; color: var(--text-muted); border-left: 2px solid transparent;
}
.docs-nav__link:hover { color: var(--text); background: var(--surface-sunken); text-decoration: none; }
.docs-nav__link.is-active { color: var(--blue); border-left-color: var(--blue); font-weight: 600; }

.docs-body { flex: 1; min-width: 0; max-width: 46rem; }
.docs-section { padding-block: 1.5rem 2.5rem; scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.docs-section + .docs-section { border-top: 1px solid var(--border); }
.docs-section h2 { font-size: 1.5rem; margin-bottom: .75rem; }
.docs-section h3 { font-size: 1.0625rem; margin: 1.75rem 0 .625rem; }
.docs-section p, .docs-section li { color: var(--text-muted); line-height: 1.75; }
.docs-section li { margin-bottom: .375rem; }

.method {
  display: inline-flex; align-items: center;
  padding: .125rem .4375rem; border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: .6875rem; font-weight: 700; letter-spacing: .04em;
  background: var(--blue); color: var(--white);
}
.method--get { background: var(--navy); }

.endpoint {
  display: flex; align-items: center; gap: .625rem; flex-wrap: wrap;
  padding: .75rem 1rem; margin-bottom: 1rem;
  background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-md);
  font-family: var(--font-mono); font-size: .875rem; word-break: break-all;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ERROR PAGES
   ═══════════════════════════════════════════════════════════════════════════ */

.error-body { background: var(--surface); }
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.error-page__inner { max-width: 30rem; text-align: center; }
.error-page__brand { display: inline-flex; color: var(--navy); margin-bottom: 2rem; }
.error-page__brand:hover { text-decoration: none; }
.error-page__code {
  font-size: .8125rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue); margin-bottom: .5rem;
}
.error-page__title { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: .75rem; }
.error-page__blurb { color: var(--text-muted); line-height: 1.7; margin-bottom: 2rem; }
.error-page__actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}.mb-4{margin-bottom:2rem}
.text-center{text-align:center}.text-right{text-align:right}
.nowrap{white-space:nowrap}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.full{width:100%}
.hidden{display:none !important}
.tabular{font-variant-numeric:tabular-nums}
.break{word-break:break-word}
.flex-1{flex:1;min-width:0}

/* Visibility by breakpoint. `.lg-hidden` is how a component that duplicates
   the sidebar on desktop (the admin mobile nav) stays out of the way there. */
.lg-only{display:none}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   Mobile-first. The breakpoints below are the ones that matter for this
   product: 480 (large phone), 768 (tablet), 1024 (laptop + sidebar appears),
   1280 (desktop).
   ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 480px) {
  .grid--2, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .dl__row { padding: .875rem 0; }
}

@media (min-width: 768px) {
  .container { padding-inline: 2rem; }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats-strip { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .app-main { padding: 1.75rem 1.75rem 5.5rem; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .auth__main { padding: 3rem 2rem; }
  .card { padding: 1.75rem; }
}

@media (min-width: 1024px) {
  /* The desktop navigation replaces the drawer entirely. */
  .nav, .nav-actions { display: flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }

  .app-sidebar { display: block; }
  .bottom-nav  { display: none; }
  .app-main    { padding: 2rem 2rem 3rem; }

  .docs-nav { display: block; }
  .lg-hidden { display: none !important; }
  .lg-only   { display: block; }

  .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 3.5rem; }
  .auth { grid-template-columns: 1.1fr 1fr; }
  .auth__aside { display: flex; flex-direction: column; justify-content: center; }
  .dl { grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 2.5rem; }
}

@media (min-width: 1280px) {
  .app-main { padding: 2.25rem 2.5rem 3rem; }
  .app-sidebar { width: 264px; flex-basis: 264px; }
}

/* Very small phones (320px). Nothing may overflow; density comes down. */
@media (max-width: 359px) {
  .container { padding-inline: 1rem; }
  .card { padding: 1.125rem; }
  .stat__value { font-size: 1.5rem; }
  .btn { padding-inline: 1rem; }
  .brand-logo__word { font-size: 1.125rem; }
}

/* ── Motion ──────────────────────────────────────────────────────────────── */

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

/* ── Print ───────────────────────────────────────────────────────────────── */

@media print {
  .site-header, .site-footer, .app-topbar, .app-sidebar, .bottom-nav,
  .nav-toggle, .mobile-nav, .btn, .pagination { display: none !important; }
  body { background: #fff; }
  .app-main { padding: 0; }
  .card, .table-wrap { border-color: #ccc; box-shadow: none; break-inside: avoid; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}
