/* ─────────────────────────────────────────────────────────────────────────────
   W2 — Brea Terminal website shell. Same visual language as the Terminal and
   Admin console: dark graphite, blue as accent only (UI-35 discipline),
   restrained layout, no animation budget. External stylesheet only — the
   pages ship zero inline styles/scripts so the strict 'self' CSP holds.
   ──────────────────────────────────────────────────────────────────────────── */

:root {
  --bg:      #101014;
  --panel:   #17171d;
  --panel-2: #1d1d25;
  --line:    rgba(255,255,255,0.09);
  --text:    rgba(255,255,255,0.92);
  --muted:   rgba(255,255,255,0.55);
  --faint:   rgba(255,255,255,0.35);
  --blue:    #3d8eff;
  --green:   #3ee08a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── header ── */
.bt-header {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.bt-brand {
  font-weight: 700; letter-spacing: 0.14em; font-size: 15px;
  color: var(--text); flex: 1;
}
.bt-brand:hover { text-decoration: none; }
.bt-brand-sub { color: var(--blue); }
.bt-nav { display: flex; align-items: center; gap: 10px; }

/* ── buttons ── */
.bt-btn {
  display: inline-block;
  font-size: 13.5px; font-weight: 600;
  padding: 9px 18px; border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--text); background: transparent;
  cursor: pointer;
}
.bt-btn:hover { background: var(--panel-2); text-decoration: none; }
.bt-btn-primary {
  background: var(--blue); border-color: var(--blue); color: #fff;
}
.bt-btn-primary:hover { background: #2f7ef0; }
.bt-btn[disabled] {
  opacity: 0.45; cursor: default;
}
.bt-btn[disabled]:hover { background: var(--blue); }
.bt-btn-ghost[disabled]:hover { background: transparent; }

/* ── homepage ── */
/* The home main fills the space between header and footer and centers the
   hero+features block in it — the footer rides the true page bottom. When
   content is taller than the viewport (small screens) the flex container
   grows with it, so centering never clips. */
.bt-home {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
}
.bt-hero {
  max-width: 880px; margin: 0 auto;
  padding: 40px 28px 44px; text-align: center;
}
.bt-hero h1 {
  font-size: 40px; line-height: 1.15; font-weight: 700;
  letter-spacing: -0.01em; margin-bottom: 18px;
}
.bt-hero h1 .bt-accent { color: var(--blue); }
.bt-hero .bt-sub {
  color: var(--muted); font-size: 17px; max-width: 640px;
  margin: 0 auto 30px;
}
.bt-hero .bt-cta { display: flex; gap: 12px; justify-content: center; }

.bt-features {
  max-width: 980px; margin: 0 auto; padding: 12px 28px 40px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.bt-feature {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 20px 18px; text-align: left;
}
.bt-feature h3 {
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em;
  margin-bottom: 6px; color: var(--text);
}
.bt-feature h3 .bt-dot { color: var(--green); }
.bt-feature p { color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .bt-features { grid-template-columns: repeat(2, 1fr); }
  .bt-hero h1 { font-size: 30px; }
}
@media (max-width: 440px) {
  .bt-features { grid-template-columns: 1fr; }
}

/* ── account shell pages (sign-in / create-account / forgot-password) ── */
.bt-account-wrap {
  flex: 1; display: flex; align-items: flex-start; justify-content: center;
  padding: 72px 20px 60px;
}
.bt-card {
  width: 100%; max-width: 380px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 28px;
}
.bt-card h1 { font-size: 20px; margin-bottom: 6px; }
.bt-card .bt-card-sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.bt-field { margin-bottom: 12px; }
.bt-field label {
  display: block; font-size: 12px; color: var(--muted);
  margin-bottom: 5px; letter-spacing: 0.03em;
}
.bt-field input {
  width: 100%; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 7px; color: var(--text); font-size: 14px;
}
.bt-field input::placeholder { color: var(--faint); }
.bt-card .bt-btn { width: 100%; margin-top: 6px; }
.bt-card-links {
  margin-top: 16px; font-size: 12.5px; color: var(--muted);
  display: flex; justify-content: space-between; gap: 10px;
}

/* W3 — form messaging + account page */
.bt-error {
  margin-bottom: 14px; padding: 10px 12px;
  background: rgba(255,87,87,0.08);
  border: 1px solid rgba(255,87,87,0.3);
  border-radius: 7px;
  color: #ff8a8a; font-size: 12.5px;
}
.bt-success {
  margin-top: 4px; padding: 10px 12px;
  background: rgba(62,224,138,0.07);
  border: 1px solid rgba(62,224,138,0.28);
  border-radius: 7px;
  color: var(--green); font-size: 12.5px;
}
.bt-acct-list { margin: 6px 0 4px; }
.bt-acct-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.bt-acct-row:last-child { border-bottom: none; }
.bt-acct-row dt { color: var(--muted); font-size: 12.5px; }
.bt-acct-row dd { font-size: 13.5px; text-align: right; word-break: break-all; }
.bt-acct-row dd.bt-ok { color: var(--green); }

.bt-notice {
  margin-top: 18px; padding: 10px 12px;
  background: rgba(61,142,255,0.07);
  border: 1px solid rgba(61,142,255,0.25);
  border-radius: 7px;
  color: var(--muted); font-size: 12.5px;
}

/* W5 — Connect Extension (account page) */
.bt-pair {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.bt-pair h2 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.bt-pair-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.bt-pair-code-wrap {
  margin-bottom: 12px; padding: 14px 12px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 9px; text-align: center;
}
/* Code row: the six digits stay the strongest element, centered in the
   remaining width; the Copy control (icon + text, whole thing clickable)
   sits at the right edge of the card. Wraps below the code on very narrow
   viewports rather than crowding it. */
.bt-pair-code-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.bt-pair-code {
  flex: 1 1 auto; min-width: 0; text-align: center;
  font: 600 32px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.32em; text-indent: 0.32em; /* centers despite trailing tracking */
  color: var(--text); user-select: all;
}
.bt-copy {
  flex: 0 0 auto; margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 6px;
  background: none; border: 1px solid transparent;
  color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600;
  line-height: 1; cursor: pointer; white-space: nowrap;
}
.bt-copy:hover { background: rgba(255,255,255,0.06); border-color: var(--line); }
.bt-copy:focus-visible { outline: none; border-color: var(--blue); }
.bt-copy .bt-copy-icon { display: block; flex: 0 0 auto; }
.bt-copy.bt-copied { color: var(--green); }
.bt-copy.bt-copied .bt-copy-icon { display: none; }
.bt-copy[disabled] { opacity: 0.35; cursor: default; }
.bt-copy[disabled]:hover { background: none; border-color: transparent; }
.bt-pair-code.bt-pair-stale { color: var(--faint); text-decoration: line-through; }
.bt-pair-hint { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.bt-pair-expiry { color: var(--faint); font-size: 12px; margin-top: 2px; }
.bt-pair-expiry.bt-pair-expired { color: #ff8a8a; }
.bt-pair-status {
  margin-bottom: 12px; padding: 10px 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  border-radius: 7px; color: var(--muted); font-size: 12.5px;
}
.bt-pair-note { color: var(--faint); font-size: 11.5px; margin-top: 8px; }
.bt-card .bt-pair .bt-btn { margin-top: 0; }
.bt-card .bt-pair .bt-error { margin-bottom: 12px; }

/* W6 — account page sections */
.bt-account-wide { padding-top: 48px; }
.bt-card-wide { max-width: 640px; }
.bt-sec { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.bt-sec h2 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.bt-sec h3 { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.bt-sec-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.bt-sec-block { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.bt-sec-block:first-of-type { margin-top: 8px; padding-top: 0; border-top: none; }
.bt-card .bt-btn-inline { width: auto; margin-top: 0; padding: 8px 14px; font-size: 12.5px; }
.bt-status-line { margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.bt-status-line.bt-ok { color: var(--green); }
.bt-status-line.bt-err { color: #ff8a8a; }

/* extension sessions */
.bt-ext-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.bt-ext-empty { color: var(--faint); font-size: 12.5px; padding: 8px 0; }
.bt-ext-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
}
.bt-ext-main { min-width: 0; }
.bt-ext-browser { font-size: 13.5px; font-weight: 600; }
.bt-ext-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.bt-ext-meta span + span::before { content: "·"; margin: 0 6px; color: var(--faint); }
.bt-ext-actions { margin: 4px 0 14px; }
.bt-pair { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.bt-pair h3 { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }

/* recent activity */
.bt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 16px; }
.bt-stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; text-align: center; }
.bt-stat-n { font-size: 22px; font-weight: 700; line-height: 1.1; }
.bt-stat-l { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; margin-top: 4px; }
.bt-act-h3 { margin-top: 4px; }
.bt-act-list { display: flex; flex-direction: column; }
.bt-act-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.bt-act-row:last-child { border-bottom: none; }
.bt-act-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-act-when { color: var(--faint); font-size: 11.5px; margin-top: 1px; }
.bt-act-action { flex: 0 0 auto; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.bt-act-action.bt-buy { color: var(--green); border-color: rgba(62,224,138,0.35); }
.bt-act-action.bt-negotiate { color: var(--blue); border-color: rgba(61,142,255,0.35); }
.bt-act-action.bt-pass { color: #ff8a8a; border-color: rgba(255,87,87,0.3); }
@media (max-width: 520px) { .bt-stats { grid-template-columns: repeat(2, 1fr); } }

/* ── footer ── */
.bt-footer {
  border-top: 1px solid var(--line);
  padding: 18px 28px; color: var(--faint); font-size: 12px;
  display: flex; justify-content: space-between; gap: 12px;
}
