/* ============================================================
   FlowTrade v4 — standalone pages
   Landing, register, sign-in, account, subscription and admin.
   Deliberately separate from app.css: the terminal is a fixed
   viewport with overflow hidden, these pages are documents that
   scroll. The palette is the terminal's so the product reads as
   one thing.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #131722;
  --panel: #1e222d;
  --panel-2: #232838;
  --line: #2a2e39;
  --text: #d1d4dc;
  --muted: #787b86;
  --strong: #ffffff;
  --blue: #2962ff;
  --green: #26a69a;
  --red: #ef5350;
  --amber: #f0b90b;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'JetBrains Mono', Menlo, Monaco, Consolas, monospace; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

/* ── Navigation ───────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 22px;
  background: rgba(19, 23, 34, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

/* The administrator's own line, printed under the navigation and only when the
   field has something in it. Scrolling carries it away with the page rather
   than keeping it pinned: a banner that never leaves is an ad. */
.site-announcement {
  background: rgba(41, 98, 255, 0.14);
  border-bottom: 1px solid var(--line);
  color: var(--strong);
  font-size: 14px;
  padding: 9px 22px;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--strong);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.site-links { display: flex; gap: 16px; margin-left: 8px; flex: 1; }
.nav-link { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--strong); }

.nav-account { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.nav-account .who { color: var(--muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Page shell ───────────────────────────────────────────────────── */
.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 34px 22px 60px;
}
.page.wide { max-width: 1080px; }

.page-title { color: var(--strong); font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.page-sub { color: var(--muted); margin-top: 6px; }
.page-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}
.card.tight { padding: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
/* The plan cards are the catalogue's own length, so the row is sized by the
   container rather than by how many tiers exist this month. */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 40px 0 30px; }
.hero h1 {
  color: var(--strong);
  font-size: 40px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 720px;
  margin: 0 auto;
}
.hero p { color: var(--muted); font-size: 17px; max-width: 620px; margin: 16px auto 0; }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.hero-note { color: var(--muted); font-size: 13px; margin-top: 14px; }

.feature { padding: 16px; }
.feature h3 { color: var(--strong); font-size: 15px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 14px; }

/* ── Forms ────────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  padding: 11px 12px;
  width: 100%;
}
.field textarea { font-family: inherit; line-height: 1.5; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); }
.field .hint { font-size: 12px; color: var(--muted); }

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--strong);
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--blue); }
.btn-buy { background: var(--green); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--text); }
.btn-outline:hover { border-color: var(--muted); }
.btn-block { display: block; width: 100%; }
.btn.small { font-size: 12px; padding: 6px 10px; }

.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.form-alt { font-size: 14px; color: var(--muted); margin-top: 14px; }

/* ── Messages ─────────────────────────────────────────────────────── */
.page-message { border-radius: 8px; font-size: 14px; margin-bottom: 14px; padding: 10px 12px; }
.page-message.error { background: rgba(239, 83, 80, 0.12); color: #ff8a80; border: 1px solid rgba(239, 83, 80, 0.35); }
.page-message.ok { background: rgba(38, 166, 154, 0.12); color: #4db6ac; border: 1px solid rgba(38, 166, 154, 0.35); }
.page-message.info { background: rgba(41, 98, 255, 0.1); color: #90b4ff; border: 1px solid rgba(41, 98, 255, 0.3); }

/* ── Rows of facts ────────────────────────────────────────────────── */
.rows { display: grid; gap: 8px; }
.row { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.row .lbl { color: var(--muted); }
.row .val { color: var(--text); text-align: right; word-break: break-word; }

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  vertical-align: 2px;
}
.badge.free { background: rgba(120, 123, 134, 0.18); color: #9aa0aa; }
.badge.pro { background: rgba(41, 98, 255, 0.18); color: #7ba4ff; }
.badge.starter { background: rgba(124, 77, 255, 0.18); color: #a78bfa; }
.badge.active { background: rgba(38, 166, 154, 0.18); color: var(--green); }
.badge.pending, .badge.trialing { background: rgba(240, 185, 11, 0.16); color: var(--amber); }
.badge.canceled, .badge.none, .badge.suspended { background: rgba(239, 83, 80, 0.14); color: #ff8a80; }
.badge.admin { background: rgba(240, 185, 11, 0.16); color: var(--amber); }
.badge.guest { background: rgba(120, 123, 134, 0.18); color: #9aa0aa; }
.badge.live { background: rgba(38, 166, 154, 0.18); color: var(--green); }

/* The label that separates two tables of figures in one card. */
.rows-caption {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  margin: 18px 0 8px;
  text-transform: uppercase;
}

/* ── Plan cards ───────────────────────────────────────────────────── */
.plan-card { position: relative; }
.plan-card.current { border-color: var(--blue); }
.plan-name { color: var(--strong); font-size: 18px; font-weight: 700; }
.plan-price { color: var(--strong); font-size: 28px; font-weight: 700; margin: 8px 0 2px; }
.plan-price small { color: var(--muted); font-size: 13px; font-weight: 500; }
.plan-blurb { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.plan-features { list-style: none; display: grid; gap: 7px; margin-bottom: 16px; }
.plan-features li { color: var(--text); font-size: 14px; padding-left: 18px; position: relative; }
.plan-features li::before { content: ''; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.plan-tag { position: absolute; right: 16px; top: 16px; }

/* ── Usage meters ─────────────────────────────────────────────────── */
.meters { display: grid; gap: 12px; }
.meter .meter-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.meter .meter-top .lbl { color: var(--muted); text-transform: capitalize; }
.meter .meter-top .num { color: var(--text); }
.meter .track { background: var(--bg); border-radius: 999px; height: 6px; overflow: hidden; }
.meter .fill { height: 100%; background: var(--blue); border-radius: 999px; }
.meter.full .fill { background: var(--amber); }

/* ── Stats and tables ─────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.stat .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat .v { color: var(--strong); font-size: 22px; font-weight: 700; margin-top: 4px; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.roster-pager { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 9px 12px; text-align: left; white-space: nowrap; }
th { background: var(--panel-2); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; }
tbody tr { border-top: 1px solid var(--line); }
td.actions { display: flex; gap: 6px; flex-wrap: wrap; white-space: normal; }
td.actions select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); font-size: 12px; padding: 3px 6px;
}
.up { color: var(--green); }
.down { color: var(--red); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }

/* ── Footer ───────────────────────────────────────────────────────── */
.site-foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  flex-wrap: wrap;
  margin-top: auto;
  padding: 18px 22px;
}
.foot-links { display: flex; gap: 14px; }
.foot-links a { color: var(--muted); }

/* ── Narrow screens ───────────────────────────────────────────────── */
@media (max-width: 820px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 31px; }
  .site-links { gap: 12px; }
  .nav-account .who { display: none; }
}

@media (max-width: 600px) {
  .page { padding: 22px 14px 48px; }
  .page-title { font-size: 22px; }
  .hero { padding: 22px 0 18px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 15px; }
  .card { padding: 16px; }

  /* Four links will not fit beside the account chip, and the navigation is the
     one thing a phone reader has to keep reaching. */
  .site-nav { gap: 10px; padding: 10px 14px; }
  .site-links { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .site-links::-webkit-scrollbar { display: none; }
  .nav-link { padding: 6px 2px; white-space: nowrap; }
  .site-announcement { padding: 8px 14px; font-size: 13px; }

  /* A thumb, not a cursor: anything you tap is at least this tall. */
  .btn { padding: 12px 16px; min-height: 44px; }
  .btn.small { padding: 8px 12px; min-height: 36px; }
  .field input, .field select, .field textarea {
    padding: 12px;
    /* Safari zooms the whole page in when a focused field sets its text below
       16px, which leaves a form stuck half-scrolled sideways. */
    font-size: 16px;
  }
  .form-actions { flex-wrap: wrap; }

  .table-scroll { -webkit-overflow-scrolling: touch; }
  th, td { padding: 10px; }
  .plan-price { font-size: 24px; }
  .site-foot { padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); }
}

@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 600px) {
    .site-nav { padding-top: calc(10px + env(safe-area-inset-top)); }
  }
}
