/* ==========================================================================
   The Developer by Shtim: the ONE stylesheet for the whole system
   (public site, client portal, admin). Dark theme first, phone first.

   How to use it (classes other pages may rely on; keep these names stable):
   Layout
     .container        centred column, max 1080px, 16px side gutter (20px on wider screens)
     .container-narrow  same, max 760px (long text: terms, billing)
     .stack            vertical rhythm: gap between direct children (use .stack-sm / .stack-lg to change)
     .grid             responsive card grid (1 column on phones, 2-3 on wider screens)
     .grid-2           always 2 columns from 640px up
     .row              horizontal flex row that wraps, with gap
   Page frame
     .site-header      sticky top bar: .brand (logo icon + name), .site-nav, .header-cta
     .site-footer      bottom bar with links and contact
     main#main         page content (a skip link "#main" is in every page)
   Text
     h1-h3             headings (h1 fluid size); .lead (bigger intro text); .muted (secondary text)
     .eyebrow          small uppercase label above a heading
     .accent           violet text (readable violet, contrast > 4.5:1)
     .small            smaller text
   Boxes
     .card             raised box with border and soft glow
     .panel            flatter box for groups of content (forms, settings)
     .notice           highlighted note (add .notice-warn or .notice-bad for warnings and errors)
   Buttons
     .btn              base button (works on <a> and <button>); .btn-primary (violet gradient),
                       .btn-ghost (outline); .btn-sm (smaller); .btn-block (full width)
   Forms
     label, input, textarea, select: styled by default.
     .field            wraps one label + control + .hint / .error
     .hint             help text under a field; .error: error text (also .field.has-error)
     .checkbox         label wrapping a checkbox or radio and its text (one tap target)
   Tables
     .table-wrap       wrap every table in it. On phones (< 640px) a table with class
                       .table-stack becomes cards: give each <td> a data-label="Column name".
   Badges
     .badge            small status pill; .badge-ok (green), .badge-warn (amber), .badge-bad (red)
   Helpers
     .visually-hidden  hidden on screen, read by screen readers
     .skip-link        "Skip to content" link
   Tokens are on :root (colours, radius, spacing). The portal/admin may append its own
   rules at the very end, under a comment that reads "app".
   ========================================================================== */

:root {
  color-scheme: dark;
  /* Brand colours (plan H2) */
  --bg: #05051A;            /* page background, near-black navy */
  --panel: #0D0A2A;         /* raised panels */
  --panel-2: #141036;       /* inputs, hover */
  --line: rgba(192, 96, 248, 0.22);
  --line-strong: rgba(192, 96, 248, 0.45);
  --text: #EDEDF4;          /* silver-white, 17:1 on --bg */
  --muted: #A9A8C2;         /* secondary text, 8.6:1 on --bg */
  --violet: #A63CF8;        /* brand violet: decoration and large text only (4.4:1) */
  --violet-text: #C060F8;   /* violet for normal-size text, 6.0:1 on --bg */
  --violet-soft: #C98BFA;   /* links, 8.2:1 on --bg */
  --violet-deep: #7000E0;   /* deep violet: gradients, never text */
  --ok: #5EE0A0;
  --warn: #F5C25B;
  --bad: #FF7A8A;
  --glow: 0 0 0 1px var(--line), 0 10px 40px -12px rgba(166, 60, 248, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --gutter: 16px;
  --header-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  scroll-padding-top: calc(var(--header-h) + 12px);
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 520px at 85% -120px, rgba(112, 0, 224, 0.22), transparent 70%),
    radial-gradient(700px 420px at -10% 10%, rgba(166, 60, 248, 0.10), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(166, 60, 248, 0.25);
  touch-action: manipulation;
  overflow-wrap: break-word;
}
/* iPhone (Safari 26): solid strip behind the status bar, in the header colour */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: 60;
}
main { flex: 1 0 auto; }
img, svg, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.15rem; }
h1[id], h2[id], h3[id], section[id] { scroll-margin-top: calc(var(--header-h) + 12px); }
p, ul, ol, dl { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: 0.35em; }
strong { font-weight: 650; color: #fff; }
small, .small { font-size: 0.875rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
code { font-family: var(--font-mono); font-size: 0.92em; }

a { color: var(--violet-soft); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--violet-soft); outline-offset: 3px; border-radius: 6px; }

.muted { color: var(--muted); }
.accent { color: var(--violet-text); }
.lead { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); color: var(--muted); line-height: 1.55; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--violet-text);
  margin-bottom: 0.6rem;
}
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

.visually-hidden {
  position: absolute !important; 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: 12px; top: -100px; z-index: 100;
  background: var(--panel); color: var(--text); padding: 10px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 8px); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.container-narrow { max-width: 760px; }
@media (min-width: 640px) { :root { --gutter: 24px; } }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack > * { margin: 0; }
.stack-sm { gap: 0.5rem; }
.stack-lg { gap: 2rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section + .section { padding-top: 0; }
.page-head { padding: clamp(1.75rem, 5vw, 3.5rem) 0 1.25rem; }
.page-head .lead { max-width: 46rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(5, 5, 26, 0.88);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  min-height: var(--header-h);
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  color: var(--text); text-decoration: none;
  margin-right: auto;
}
.brand img { width: 36px; height: 36px; flex-shrink: 0; filter: drop-shadow(0 0 10px rgba(166, 60, 248, 0.45)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand-name span { color: var(--violet-text); }
.brand-by { font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.brand:hover { color: var(--text); }

.site-nav { order: 3; width: 100%; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 4px; }
.site-nav li + li { margin-top: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px;
  color: var(--muted); text-decoration: none; font-size: 0.95rem; border-radius: 8px;
  white-space: nowrap;
}
.site-nav li:first-child a { padding-left: 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--violet); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.header-cta { order: 2; flex-shrink: 0; }

@media (min-width: 860px) {
  .site-header .container { flex-wrap: nowrap; }
  .site-nav { order: 2; width: auto; }
  .site-nav li:first-child a { padding-left: 10px; }
  .header-cta { order: 3; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  background: rgba(13, 10, 42, 0.6);
  padding: 2rem 0 calc(2rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.92rem;
  color: var(--muted);
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: flex-start; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer li + li { margin-top: 0; }
.site-footer a { color: var(--muted); display: inline-block; padding: 6px 0; }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text);
  font: 600 1rem/1 var(--font); text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn:hover { color: #fff; border-color: var(--violet-soft); background: rgba(166, 60, 248, 0.10); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--violet-deep), var(--violet));
  color: #fff;
  box-shadow: 0 6px 24px -8px rgba(166, 60, 248, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover { background: linear-gradient(135deg, #7d10ea, #b04ef9); border-color: transparent; box-shadow: 0 8px 30px -8px rgba(192, 96, 248, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-ghost { background: rgba(13, 10, 42, 0.5); }
.btn-danger { border-color: rgba(255, 122, 138, 0.5); color: var(--bad); }
.btn-danger:hover { background: rgba(255, 122, 138, 0.1); border-color: var(--bad); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.9rem; }
.btn-block { display: flex; width: 100%; }
@media (max-width: 359px) { .header-cta.btn { padding: 0 14px; font-size: 0.92rem; } }

/* ---------- Boxes ---------- */
.card {
  background: linear-gradient(180deg, rgba(20, 16, 54, 0.9), rgba(13, 10, 42, 0.9));
  border-radius: var(--radius);
  box-shadow: var(--glow);
  padding: 1.25rem;
}
.card > :last-child, .panel > :last-child, .notice > :last-child { margin-bottom: 0; }
.card h3 { margin-bottom: 0.35em; }
.card .badge + h3 { margin-top: 0.75rem; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
@media (min-width: 640px) { .card, .panel { padding: 1.5rem; } }
.notice {
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--violet);
  background: rgba(166, 60, 248, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}
.notice-warn { border-color: rgba(245, 194, 91, 0.45); border-left-color: var(--warn); background: rgba(245, 194, 91, 0.07); }
.notice-bad { border-color: rgba(255, 122, 138, 0.45); border-left-color: var(--bad); background: rgba(255, 122, 138, 0.07); }
.notice-ok { border-color: rgba(94, 224, 160, 0.45); border-left-color: var(--ok); background: rgba(94, 224, 160, 0.07); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.35em;
  padding: 2px 10px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; line-height: 1.6; white-space: nowrap;
  border: 1px solid var(--line-strong); color: var(--violet-soft); background: rgba(166, 60, 248, 0.10);
}
.badge-ok { color: var(--ok); border-color: rgba(94, 224, 160, 0.45); background: rgba(94, 224, 160, 0.08); }
.badge-warn { color: var(--warn); border-color: rgba(245, 194, 91, 0.45); background: rgba(245, 194, 91, 0.08); }
.badge-bad { color: var(--bad); border-color: rgba(255, 122, 138, 0.45); background: rgba(255, 122, 138, 0.08); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
input, textarea, select {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background-color: var(--panel-2);
  color: var(--text);
  font: 400 1rem/1.4 var(--font); /* 16px+ stops iPhone zoom on focus */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-height: 140px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat; }
input::placeholder, textarea::placeholder { color: #7f7e9c; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; border-color: var(--violet-soft); box-shadow: 0 0 0 3px rgba(166, 60, 248, 0.35);
}
input[type="checkbox"], input[type="radio"] {
  width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; flex-shrink: 0;
  accent-color: var(--violet);
}
input[type="file"] { padding: 10px; min-height: 0; }
.field { margin-bottom: 1.1rem; }
.field > :last-child { margin-bottom: 0; }
.hint { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.875rem; font-weight: 400; }
.error { display: block; margin-top: 0.35rem; color: var(--bad); font-size: 0.9rem; }
.field.has-error input, .field.has-error textarea, .field.has-error select,
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; padding: 6px 0; }
.checkbox input { margin-top: 3px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1.1rem; }
legend { font-weight: 600; padding: 0 0.4rem; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 639px) {
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { border: 0; padding: 4px 0; display: flex; gap: 12px; justify-content: space-between; text-align: right; }
  .table-stack td::before { content: attr(data-label); color: var(--muted); font-size: 0.85rem; text-align: left; flex-shrink: 0; }
  .table-stack td.num { text-align: right; }
}

/* ---------- Public site pieces ---------- */
.hero { padding: clamp(1.75rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 3rem); min-height: calc(100svh - var(--header-h) - 34px); }
@media (min-width: 860px) { .hero { min-height: calc(100svh - var(--header-h)); } }
.hero-inner { display: grid; gap: 1.5rem; align-items: center; }
.hero h1 { margin-bottom: 0.4em; }
.hero h1 .accent { color: var(--violet-text); }
.hero .lead { max-width: 40rem; }
.hero-art { display: none; }
.hero-art img { width: 100%; max-width: 360px; margin: 0 auto; filter: drop-shadow(0 0 60px rgba(166, 60, 248, 0.45)); }
@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1.4fr 1fr; }
  .hero-art { display: block; }
}
.hero-facts { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.6rem; }
.hero-facts li { margin: 0; display: flex; gap: 10px; align-items: baseline; color: var(--muted); }
.hero-facts strong { color: var(--text); }
.hero-facts li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 10px var(--violet); flex-shrink: 0; transform: translateY(-2px); }

.price { font-size: clamp(2.2rem, 1.8rem + 2vw, 3rem); font-weight: 750; letter-spacing: -0.02em; line-height: 1; margin: 0.25rem 0 0.5rem; font-variant-numeric: tabular-nums; }
.price small { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 1rem; }
.steps > li { counter-increment: step; position: relative; padding-left: 52px; margin: 0; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--violet-deep), var(--violet));
  box-shadow: 0 0 18px rgba(166, 60, 248, 0.5);
}
.steps h3 { margin: 0.2rem 0 0.25rem; }
.steps p { margin: 0; color: var(--muted); }

.timeline { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.5rem; }
.timeline li { margin: 0; display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.75rem; padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); background: rgba(20, 16, 54, 0.7); border: 1px solid var(--line); }
.timeline .t { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--violet-soft); white-space: nowrap; }
@media (max-width: 380px) { .timeline li { grid-template-columns: 1fr; gap: 0.15rem; } }

.faq details { border-bottom: 1px solid var(--line); padding: 0.25rem 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 0.75rem 0; list-style-position: outside; }
.faq details p { color: var(--muted); }

.cta-band { text-align: center; padding: clamp(2rem, 5vw, 3rem) 1.25rem; }
.cta-band .row { justify-content: center; }

.toc { font-size: 0.95rem; }
.toc ol { margin: 0.5rem 0 0; columns: 1; }
@media (min-width: 640px) { .toc ol { columns: 2; column-gap: 2rem; } }

/* Long legal / explainer text */
.prose:not(.container) { max-width: 46rem; }
.table-wrap { margin-bottom: 1em; }
.prose h2 { margin-top: 2.25rem; font-size: 1.35rem; }
.prose h3 { margin-top: 1.5rem; }
.prose p, .prose li { color: #d9d9e6; }
.prose ol > li, .prose ul > li { padding-left: 0.2em; }
.placeholder { color: var(--warn); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  .prose p, .prose li { color: #000; }
}
