/* ============================================================
   AlphaBack — interior pages
   ------------------------------------------------------------
   Shared by every page that is not the home page or the app:
   features, showcase, docs, changelog, contact, security,
   pricing, faq, how-it-works, terms, privacy, login.

   Load order: tokens.css → shell.css → page.css
   Responsive @media blocks live at the END of this file.
   ============================================================ */

/* ════════════════════════════════════════════════════════════
   PAGE HERO — compact. Interior pages earn attention with
   content, not with a second full-height hero.
   ════════════════════════════════════════════════════════════ */

.page-hero { padding-block: calc(var(--nav-h) + var(--sp-8)) var(--sp-9); }
.page-hero .h1 { font-size: clamp(34px, 5vw, 56px); }
.page-hero-head { max-width: 760px; }
.page-hero-head.is-center { margin-inline: auto; text-align: center; }
.page-hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }

/* ════════════════════════════════════════════════════════════
   DOC LAYOUT — sticky contents rail + body. Used by docs,
   security, terms and privacy.
   ════════════════════════════════════════════════════════════ */

.doc {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: var(--sp-9);
  align-items: start;
}
.doc-rail { position: sticky; top: calc(var(--nav-h) + var(--sp-6)); }
.doc-rail-head {
  font-family: 'DM Mono', monospace;
  font-size: var(--fs-1); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--t3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--bdr);
  margin-bottom: var(--sp-3);
}
.doc-rail a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-2); color: var(--t3); text-decoration: none;
  border-left: 2px solid transparent;
  transition: color var(--dur) ease, background var(--dur) ease, border-color var(--dur) ease;
}
.doc-rail a:hover { color: var(--text); background: rgba(255,255,255,0.045); }
.doc-rail a.is-current { color: var(--text); border-left-color: var(--accent); }

.doc-body { max-width: var(--maxw-prose); }
.doc-body h2 {
  font-family: 'Manrope', sans-serif;
  font-size: var(--fs-5); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.2; margin: var(--sp-9) 0 var(--sp-4);
  scroll-margin-top: calc(var(--nav-h) + var(--sp-6));
}
.doc-body > h2:first-child { margin-top: 0; }
.doc-body h3 {
  font-family: 'Manrope', sans-serif;
  font-size: var(--fs-4); font-weight: 700; letter-spacing: -0.02em;
  margin: var(--sp-7) 0 var(--sp-3);
  scroll-margin-top: calc(var(--nav-h) + var(--sp-6));
}
.doc-body p, .doc-body li {
  font-size: var(--fs-3); line-height: 1.78; color: var(--t2);
  margin: 0 0 var(--sp-4);
  text-wrap: pretty;
}
.doc-body ul, .doc-body ol { margin: 0 0 var(--sp-4); padding-left: var(--sp-5); }
.doc-body li { margin-bottom: var(--sp-2); }
.doc-body li::marker { color: var(--t4); }
.doc-body strong { color: var(--text); font-weight: 600; }
.doc-body a {
  color: var(--text); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--accent-line);
}
.doc-body a:hover { text-decoration-color: var(--accent); }
.doc-body code {
  font-family: 'DM Mono', monospace; font-size: 0.9em;
  padding: 1px 5px; border-radius: var(--r-sm);
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 0 0 1px var(--bdr);
  color: var(--text);
}
.doc-body pre {
  margin: 0 0 var(--sp-5);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: rgba(0,0,0,0.4);
  box-shadow: inset 0 0 0 1px var(--bdr);
  overflow-x: auto;
}
.doc-body pre code {
  padding: 0; background: none; box-shadow: none;
  font-size: var(--fs-2); line-height: 1.7; color: var(--t2);
}
.doc-meta { font-size: var(--fs-2); color: var(--t3); margin-bottom: var(--sp-7); }

/* Callout — one rule, four tones via a modifier. */
.note {
  position: relative;
  margin: 0 0 var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.035);
  box-shadow: inset 0 0 0 1px var(--bdr);
  font-size: var(--fs-2); line-height: 1.7; color: var(--t2);
}
.note::before {
  content: ''; position: absolute; left: 0; top: var(--sp-4); bottom: var(--sp-4);
  width: 2px; border-radius: var(--r-full); background: var(--accent);
}
.note strong { color: var(--text); }
.note.is-warn::before { background: var(--warn); }
.note.is-neg::before  { background: var(--neg); }

/* ════════════════════════════════════════════════════════════
   FAQ — details/summary, so it works with JS disabled
   ════════════════════════════════════════════════════════════ */

.faq-group { margin-bottom: var(--sp-8); }
.faq-group-head {
  font-family: 'DM Mono', monospace;
  font-size: var(--fs-1); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-4);
  scroll-margin-top: calc(var(--nav-h) + var(--sp-6));
}
.faq-item { border-top: 1px solid var(--bdr); }
.faq-item:last-child { border-bottom: 1px solid var(--bdr); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
  padding: var(--sp-5) 0;
  cursor: pointer; list-style: none;
  font-size: var(--fs-3); font-weight: 500; color: var(--text);
  transition: color var(--dur) ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--accent); }
.faq-item summary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
/* Plus that becomes a minus. Two spans would need markup on every row. */
.faq-sign {
  position: relative; flex-shrink: 0;
  width: 16px; height: 16px;
}
.faq-sign::before, .faq-sign::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  background: var(--t3);
  transform: translate(-50%, -50%);
  transition: transform var(--dur) var(--ease-out), background var(--dur) ease;
}
.faq-sign::before { width: 12px; height: 1.5px; }
.faq-sign::after  { width: 1.5px; height: 12px; }
.faq-item[open] .faq-sign::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item[open] .faq-sign::before,
.faq-item[open] .faq-sign::after { background: var(--accent); }
.faq-answer {
  padding: 0 0 var(--sp-5);
  max-width: 68ch;
  font-size: var(--fs-3); line-height: 1.75; color: var(--t2);
}
.faq-answer p { margin: 0 0 var(--sp-3); }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer strong { color: var(--text); font-weight: 600; }

.pill-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-8); }
.pill-row a {
  text-decoration: none;
  transition: color var(--dur) ease, background var(--dur) ease;
}
.pill-row a:hover { color: var(--text); background: rgba(255,255,255,0.09); }

/* ════════════════════════════════════════════════════════════
   PRICING
   ════════════════════════════════════════════════════════════ */

.tiers {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: var(--sp-5);
  align-items: stretch;
}
.tier {
  position: relative;
  display: flex; flex-direction: column;
  padding: var(--sp-6);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.035);
  -webkit-backdrop-filter: var(--glass-2);
  backdrop-filter: var(--glass-2);
  box-shadow: 0 20px 44px -24px rgba(0,0,0,0.8);
}
.tier::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; padding: 1px;
  background: var(--glass-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
/* The featured tier is marked by a brighter ring, not by scale or colour —
   a lifted card fights the grid and a coloured one fights the palette. */
.tier.is-featured { background: rgba(255,255,255,0.06); }
.tier.is-featured::before {
  background: linear-gradient(145deg, rgba(200,212,255,0.55), rgba(200,212,255,0.10) 45%, rgba(255,255,255,0) 75%);
}
.tier-flag {
  position: absolute; top: 0; right: var(--sp-6);
  transform: translateY(-50%);
  padding: 0 var(--sp-3); height: 24px;
  display: inline-flex; align-items: center;
  border-radius: var(--r-full);
  background: linear-gradient(var(--accent), var(--accent));
  color: #0a0a0c;
  font-family: 'DM Mono', monospace;
  font-size: var(--fs-0); letter-spacing: 0.1em; text-transform: uppercase;
}
.tier-name {
  font-family: 'Manrope', sans-serif;
  font-size: var(--fs-4); font-weight: 700; letter-spacing: -0.02em;
}
.tier-price {
  display: flex; align-items: baseline; gap: var(--sp-2);
  margin: var(--sp-4) 0 var(--sp-2);
}
.tier-amount {
  font-family: 'Manrope', sans-serif;
  font-size: var(--fs-7); font-weight: 800; letter-spacing: -0.045em;
  line-height: 1;
}
.tier-per { font-size: var(--fs-2); color: var(--t3); }
.tier-note { font-size: var(--fs-2); color: var(--t3); min-height: 2.6em; }
.tier .btn { width: 100%; margin: var(--sp-5) 0; }
.tier-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.tier-list li {
  position: relative;
  padding-left: var(--sp-5);
  font-size: var(--fs-2); line-height: 1.6; color: var(--t2);
}
.tier-list li::before {
  content: ''; position: absolute; left: 0; top: 0.52em;
  width: 9px; height: 5px;
  border-left: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
}
.tier-list li.is-off { color: var(--t3); opacity: 0.6; }
.tier-list li.is-off::before {
  border: 0; width: 9px; height: 1.5px;
  background: var(--t3); transform: none; top: 0.72em;
}

/* ════════════════════════════════════════════════════════════
   COMPARISON TABLE
   ════════════════════════════════════════════════════════════ */

.table-wrap { overflow-x: auto; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--bdr); }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td {
  padding: var(--sp-4) var(--sp-5);
  text-align: left; vertical-align: top;
  font-size: var(--fs-2); line-height: 1.6;
  border-bottom: 1px solid var(--bdr);
}
.table thead th {
  font-family: 'DM Mono', monospace;
  font-size: var(--fs-1); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--t3); font-weight: 400;
  background: rgba(255,255,255,0.03);
}
.table tbody th { color: var(--text); font-weight: 600; }
.table td { color: var(--t2); }
.table tr:last-child th, .table tr:last-child td { border-bottom: 0; }
.table .is-us { background: rgba(200,212,255,0.05); color: var(--text); }

/* ════════════════════════════════════════════════════════════
   CHANGELOG
   ════════════════════════════════════════════════════════════ */

.log-entry {
  display: grid; grid-template-columns: 160px minmax(0,1fr);
  gap: var(--sp-6);
  padding: var(--sp-7) 0;
  border-top: 1px solid var(--bdr);
}
.log-entry:last-child { border-bottom: 1px solid var(--bdr); }
.log-date {
  font-family: 'DM Mono', monospace;
  font-size: var(--fs-2); color: var(--t3);
  position: sticky; top: calc(var(--nav-h) + var(--sp-6)); align-self: start;
}
.log-title {
  font-family: 'Manrope', sans-serif;
  font-size: var(--fs-4); font-weight: 700; letter-spacing: -0.02em;
  margin: 0 0 var(--sp-3);
}
.log-body { font-size: var(--fs-3); line-height: 1.75; color: var(--t2); }
.log-body p { margin: 0 0 var(--sp-3); }
.log-body ul { margin: 0; padding-left: var(--sp-5); }
.log-body li { margin-bottom: var(--sp-2); }
.log-body li::marker { color: var(--t4); }
.log-body strong { color: var(--text); font-weight: 600; }
.log-tags { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); }

/* ════════════════════════════════════════════════════════════
   FORMS — contact, login
   ════════════════════════════════════════════════════════════ */

.form { display: grid; gap: var(--sp-5); }
.field-row { display: grid; gap: var(--sp-2); }
.field-lbl {
  font-size: var(--fs-2); font-weight: 500; color: var(--t2);
}
.field {
  width: 100%;
  height: var(--h-lg);
  padding: 0 var(--sp-4);
  border: 0; border-radius: var(--r-md);
  background: var(--field-bg);
  box-shadow: inset 0 0 0 1px var(--field-bdr);
  color: var(--text);
  font-family: inherit; font-size: var(--fs-input);
  transition: box-shadow var(--dur) ease, background var(--dur) ease;
}
textarea.field { height: auto; min-height: 140px; padding: var(--sp-4); line-height: 1.6; resize: vertical; }
.field::placeholder { color: var(--t3); }
.field:hover { background: rgba(255,255,255,0.055); }
.field:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-dim); }
.field-help { font-size: var(--fs-2); color: var(--t3); }

.auth-card {
  width: 100%; max-width: 420px;
  margin-inline: auto;
  padding: var(--sp-7);
  border-radius: var(--r-lg);
}
.auth-head { text-align: center; margin-bottom: var(--sp-6); }
.auth-title {
  font-family: 'Manrope', sans-serif;
  font-size: var(--fs-5); font-weight: 800; letter-spacing: -0.03em;
  margin: 0 0 var(--sp-2);
}
.auth-sub { font-size: var(--fs-2); color: var(--t3); margin: 0; }
.auth-alt { margin-top: var(--sp-5); text-align: center; font-size: var(--fs-2); color: var(--t3); }
.auth-alt button {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}
.auth-divider {
  display: flex; align-items: center; gap: var(--sp-4);
  margin: var(--sp-5) 0;
  font-size: var(--fs-1); letter-spacing: 0.1em; text-transform: uppercase; color: var(--t3);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--bdr);
}
.auth-err {
  display: none;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: rgba(248,113,113,0.10);
  box-shadow: inset 0 0 0 1px rgba(248,113,113,0.28);
  font-size: var(--fs-2); color: var(--neg);
}
.auth-err.show { display: block; }
.auth-ok {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--accent-dim);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  font-size: var(--fs-2); color: var(--text);
}

/* ════════════════════════════════════════════════════════════
   SHOWCASE — a real report rendered as a page
   ════════════════════════════════════════════════════════════ */

.verdict {
  padding: var(--sp-7);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-6);
}
.verdict-lead {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(22px, 2.8vw, 32px); font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.28;
  margin: 0; text-wrap: balance;
}
.verdict-sub { margin: var(--sp-4) 0 0; font-size: var(--fs-3); color: var(--t2); max-width: 62ch; }

.metrics {
  display: grid; grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 1px; background: var(--bdr);
  border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: var(--sp-6);
}
.metric {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-5);
  min-height: 132px;
  background: rgba(255,255,255,0.028);
  -webkit-backdrop-filter: var(--glass-2);
  backdrop-filter: var(--glass-2);
}
.metric-lbl {
  font-family: 'DM Mono', monospace;
  font-size: var(--fs-1); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--t3);
}
.metric-val {
  font-family: 'Manrope', sans-serif;
  font-size: var(--fs-6); font-weight: 800; letter-spacing: -0.04em;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.metric-sub { font-size: var(--fs-1); color: var(--t3); }

.panel {
  padding: var(--sp-6);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-6);
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.panel-title {
  font-family: 'Manrope', sans-serif;
  font-size: var(--fs-4); font-weight: 700; letter-spacing: -0.02em;
  margin: 0;
}
.panel-note { font-size: var(--fs-2); color: var(--t3); margin: 0; }

/* Monthly returns heatmap */
.heat { display: grid; grid-template-columns: 52px repeat(12, minmax(0,1fr)); gap: 3px; min-width: 620px; }
.heat-h {
  font-family: 'DM Mono', monospace;
  font-size: var(--fs-0); color: var(--t3); text-align: center;
  padding-bottom: var(--sp-1);
}
.heat-y {
  font-family: 'DM Mono', monospace;
  font-size: var(--fs-0); color: var(--t3);
  display: flex; align-items: center;
}
.heat-c {
  aspect-ratio: 1 / 0.62;
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: var(--fs-0);
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

/* Trade log */
.trades { width: 100%; border-collapse: collapse; min-width: 620px; }
.trades th, .trades td {
  padding: var(--sp-3) var(--sp-4);
  text-align: right;
  font-family: 'DM Mono', monospace;
  font-size: var(--fs-2);
  border-bottom: 1px solid var(--bdr);
  font-variant-numeric: tabular-nums;
}
.trades th:first-child, .trades td:first-child { text-align: left; }
.trades thead th {
  font-size: var(--fs-1); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--t3); font-weight: 400;
}
.trades td { color: var(--t2); }
.trades tr:last-child td { border-bottom: 0; }

.scroll-x { overflow-x: auto; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — must stay last
   ════════════════════════════════════════════════════════════ */

@media (max-width: 1000px) {
  .doc { grid-template-columns: minmax(0,1fr); gap: var(--sp-6); }
  .doc-rail { position: static; }
  .doc-rail a { display: inline-block; border-left: 0; border-bottom: 2px solid transparent; }
  .doc-rail a.is-current { border-bottom-color: var(--accent); }
  .tiers { grid-template-columns: minmax(0,1fr); max-width: 460px; margin-inline: auto; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .log-entry { grid-template-columns: minmax(0,1fr); gap: var(--sp-3); }
  .log-date { position: static; }
}

@media (max-width: 640px) {
  .metrics { grid-template-columns: minmax(0,1fr); }
  .panel, .verdict { padding: var(--sp-5); }
  .page-hero { padding-block: calc(var(--nav-h) + var(--sp-6)) var(--sp-8); }
  .page-hero-actions .btn { width: 100%; }
}
