/* PolySmarter subscriber site.
 *
 * The palette, radii and type here are the extension panel's own design tokens
 * (`extension/src/ui/theme.css`), copied rather than imported because these
 * pages are served by Django and the panel ships inside a browser package —
 * there is no build step in common. When the panel's tokens move, move these.
 *
 * Served from our own origin because the CSP on these pages is
 * `default-src 'none'; style-src 'self'; img-src 'self'` — there is no inline
 * <style> and no script anywhere. Every page must stay readable if this file
 * 404s, which it does in a checkout that has not run collectstatic — and which
 * it did in production until the image learned to collect this app's static
 * files at all.
 */

:root {
  color-scheme: dark;
  --bg: #0f1319;
  --card: #12161c;
  --card-2: #171c24;
  --line: rgba(255, 255, 255, 0.085);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #e9edf3;
  --muted: #98a3b3;
  --faint: #67717f;
  --accent: #7a80f0;
  --accent-wash: rgba(122, 128, 240, 0.14);
  --brand: #e0531c;
  --danger: #d14a3c;
  --r-card: 14px;
  --r-row: 11px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
}

/* Brand row: the same mark and lockup the panel's header uses. */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 1.75rem;
}
.brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(224, 83, 28, 0.4);
}
.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-by {
  margin-left: 0.4em;
  color: var(--brand);
  font-weight: 650;
  font-size: 0.86em;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 1.5rem;
  margin: 1.25rem 0;
}

h2 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0.7rem 0;
}

strong {
  font-weight: 650;
}

a {
  color: var(--accent);
}

.hint,
.fine {
  color: var(--muted);
  font-size: 13px;
}

/* The handoff's own facts — install id, challenge, redirect URI.
   A two-column grid and a monospace value column, because the reader is being
   asked to CHECK these against the extension that opened the window, and in a
   proportional font two hex strings that differ in one character look the
   same. */
.detail {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.25rem;
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-row);
  background: var(--card-2);
}
.detail dt {
  color: var(--muted);
  font-size: 13px;
}
.detail dd {
  margin: 0;
  word-break: break-all;
}

/* A state the reader has to act on — a retrying payment, an unavailable
   upgrade. The bar carries the weight so the sentence does not have to. */
.notice {
  border-left: 3px solid var(--accent);
  padding: 0.1rem 0 0.1rem 0.75rem;
  background: var(--accent-wash);
  border-radius: 0 var(--r-row) var(--r-row) 0;
}

button,
.primary {
  font: inherit;
  font-weight: 650;
  padding: 0.6rem 1.1rem;
  border-radius: var(--r-row);
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--text);
  cursor: pointer;
}
button:hover {
  border-color: var(--accent);
}
.primary,
button[type='submit'].primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0d12;
}
.primary:hover {
  filter: brightness(1.08);
}
.danger {
  color: var(--danger);
  border-color: rgba(209, 74, 60, 0.4);
  background: transparent;
}

fieldset {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-row);
}
legend {
  padding: 0 0.4rem;
  color: var(--muted);
  font-size: 13px;
}
fieldset label {
  display: block;
  padding: 0.3rem 0;
}

input[type='text'],
input[type='email'] {
  font: inherit;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border-radius: var(--r-row);
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 0.5rem 0.6rem 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-weight: 650;
  font-size: 13px;
}
code,
.key {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}
form.inline {
  display: inline;
}

/* A licence key, shown once. Boxed and accented because it is the one thing on
   the page the reader has to copy before leaving it, and monospaced because it
   is a credential they may have to compare character by character. */
.secret {
  display: block;
  padding: 0.75rem;
  margin: 0.75rem 0;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--r-row);
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

/* The seats list on the account page. */
.keys {
  list-style: none;
  margin: 0;
  padding: 0;
}
.keys li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}
.seen,
.expiry,
.label {
  color: var(--muted);
  font-size: 0.85em;
}

/* The upgrade form on the connect page: prices and the checkout button. */
.upgrade {
  margin: 1.25rem 0;
}
.upgrade fieldset label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

/* Shown once, when a key is first minted. */
.key-reveal {
  border-color: var(--accent);
}

/* ------------------------------------------------------ public pages --
 *
 * `/`, `/privacy`, `/terms` and `/support`. Long-form reading rather than the
 * short interstitials above, so this block is mostly about type: a real <h1>,
 * a lede that sits above the first card, and lists that stay readable at the
 * length a policy actually runs to.
 */

h1 {
  margin: 0 0 0.75rem;
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* The opening paragraph, before the first card. Larger than body text and
   outside a card, so the page has one thing to read first. */
.lede {
  margin: 0 0 1.75rem;
  font-size: 1.05rem;
  color: var(--text);
}

/* A policy with no date cannot be superseded. */
.stamp {
  margin: -0.35rem 0 1.75rem;
  color: var(--faint);
  font-size: 13px;
}

/* Numbered and bulleted clauses. The default list indent puts the marker in
   the card's padding, where it reads as if it fell off the edge. */
.legal {
  margin: 0.7rem 0;
  padding-left: 1.35rem;
}
.legal li {
  margin: 0.55rem 0;
}

/* Prose definition lists — processors, retention windows. Deliberately NOT
   `.detail`: that one sets `word-break: break-all` so two near-identical hex
   strings can be compared character by character, which on a sentence breaks
   words mid-letter. */
.facts {
  margin: 1rem 0 0;
}
.facts dt {
  margin-top: 1rem;
  font-weight: 650;
}
.facts dd {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

/* Inline literals: a scope name, a hostname, a setting. */
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

/* The footer slot. Empty on the sign-in pages, which fill no footer block —
   `:empty` is what keeps them from growing a rule and a gap they never asked
   for. */
.pagefoot:empty {
  display: none;
}
.pagefoot {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.pagenav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 0.6rem;
}
.pagenav a {
  font-size: 14px;
  text-decoration: none;
}
.pagenav a:hover {
  text-decoration: underline;
}
