/*
 * Account pages (/org/, /users/, /billing/) and sign-in (/workspace/, /ob/).
 * Components follow John's platform mockup; colors and fonts come from
 * /css/afx-shell.css (--afx-* tokens).
 */
:root {
  --g500: var(--afx-jade);
  --g600: var(--afx-brand-600);
  --ink: var(--afx-fg);
  --ink-2: var(--afx-text-muted);
  --ink-3: var(--afx-text-subtle);
  --line: var(--afx-border-default);
  --bg: var(--afx-bg);
  --surface: var(--afx-card);
  --fd: var(--afx-font-heading);
  --fb: var(--afx-font-sans);
  --red: var(--afx-red);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--fb); font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--bg); }
a { color: inherit; }

/* Page container + header (mockup .content / .screen-head) */
.afx-shell {
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 32px 80px;
  animation: afx-fade-up 0.35s ease both;
}
.afx-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--afx-jade);
}
.afx-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--afx-jade);
}
h1 {
  margin: 0;
  font-family: var(--fd);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--afx-fg);
}
.lede {
  max-width: 70ch;
  margin: 6px 0 22px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--afx-text-muted);
}
.lede a { color: var(--afx-fg); }

/* Card (mockup .card) */
.card {
  padding: 20px;
  border: 1px solid var(--afx-border-default);
  border-radius: var(--afx-r-lg);
  background: var(--afx-card);
  box-shadow: var(--afx-shadow);
}
.card + .card { margin-top: 16px; }
.card h2 {
  margin: 0 0 4px;
  font-family: var(--fd);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--afx-fg);
}
.card p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--afx-text-muted); }
.mono {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid var(--afx-border-default);
  border-radius: var(--afx-r-sm);
  background: var(--afx-powder-soft);
  font-family: var(--afx-font-mono);
  font-size: 12.5px;
  color: var(--afx-fg);
}
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.note { margin-top: 12px; font-size: 11.5px; color: var(--afx-text-subtle); }

/* Buttons (mockup .btn / .btn-p / .btn-o) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-family: var(--fb);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:focus-visible { outline: 2px solid var(--afx-jade); outline-offset: 1px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--afx-jade); color: #fff; }
.btn-primary:hover { background: var(--afx-brand-600); }
.btn-ghost { border-color: var(--afx-border-strong); background: transparent; color: var(--afx-fg); }
.btn-ghost:hover { border-color: var(--afx-jade); }

/* Members table (mockup table) */
.card:has(> table.members) { padding: 0; overflow: hidden; }
table.members { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.members th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--afx-text-subtle);
  white-space: nowrap;
  border-bottom: 1px solid var(--afx-border-default);
}
table.members td { padding: 12px 14px; border-bottom: 1px solid var(--afx-border-default); color: var(--afx-fg); vertical-align: middle; }
table.members tbody tr:last-child td { border-bottom: 0; }
table.members tbody tr:hover td { background: color-mix(in srgb, var(--afx-powder) 6%, transparent); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--afx-jade-soft);
  color: var(--afx-jade);
  font-size: 11px;
  font-weight: 600;
}

/* Form fields (mockup .field) */
#afx-gate .field,
.card .field { max-width: 420px; margin: 0 0 14px; }
#afx-gate label,
.card .field label { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--afx-text-muted); }
#afx-gate input,
.card .field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--afx-border-strong);
  border-radius: 10px;
  background: var(--afx-card);
  color: var(--afx-fg);
  font: inherit;
  font-size: 13.5px;
}
#afx-gate input::placeholder,
.card .field input::placeholder { color: var(--afx-text-subtle); }
#afx-gate input:focus,
.card .field input:focus { outline: 2px solid var(--afx-jade); outline-offset: 1px; border-color: var(--afx-jade); }
#afx-gate input[readonly] { background: var(--afx-surface-2); color: var(--afx-text-muted); cursor: default; }
.card form { margin-top: 16px; }
#afx-pw-status,
#afx-email-status,
#afx-set-pw-status { margin: 12px 0 0; font-size: 12.5px; color: var(--afx-text-muted); }

/* ---------- Sign-in layout (html.afxs-auth, set by /js/afx-nav.js) ---------- */

.afx-signin-hero,
.afx-auth-foot { display: none; }

html.afxs-auth body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}
html.afxs-auth .afx-signin-stage {
  width: 100%;
  max-width: 1140px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}
html.afxs-auth .afx-signin-hero { display: block; }
.afx-signin-logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.afx-signin-logo .is-wordmark { height: 44px; width: auto; display: block; }
.afx-signin-logo .is-dark { display: none; align-items: center; gap: 12px; }
.afx-signin-logo .is-dark img { height: 44px; width: auto; display: block; }
.afx-signin-logo .is-dark span { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; color: var(--afx-fg); }
html[data-theme="dark"] .afx-signin-logo .is-wordmark { display: none; }
html[data-theme="dark"] .afx-signin-logo .is-dark { display: inline-flex; }
.afx-hero-word {
  margin: 26px 0 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.afx-hero-word em { font-style: normal; color: var(--afx-red); }
.afx-hero-copy { max-width: 52ch; margin: 18px 0 0; color: var(--afx-text-muted); }
.afx-signin-hero .afx-ribbon { max-width: 420px; margin-top: 26px; }
.afx-ribbon-labels {
  max-width: 420px;
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}
.afx-ribbon-labels span { font-size: 10.5px; color: var(--afx-text-subtle); }
.afx-ribbon-labels b { display: block; font-size: 12px; font-weight: 600; }
.afx-ribbon-labels > :nth-child(1) b { color: var(--afx-red); }
.afx-ribbon-labels > :nth-child(2) { text-align: center; }
.afx-ribbon-labels > :nth-child(2) b { color: var(--afx-yellow-ink); }
.afx-ribbon-labels > :nth-child(3) { text-align: right; }
.afx-ribbon-labels > :nth-child(3) b { color: var(--afx-jade); }

html.afxs-auth .afx-signin-side { width: 100%; max-width: 440px; margin: 0 auto; }
html.afxs-auth .afx-shell {
  max-width: none;
  margin: 0;
  padding: 28px;
  border: 1px solid var(--afx-border-default);
  border-radius: var(--afx-r-lg);
  background: var(--afx-card);
  box-shadow: var(--afx-shadow);
}
html.afxs-auth .afx-kicker { margin-bottom: 10px; }
html.afxs-auth h1 { font-size: 19px; }
html.afxs-auth .lede { margin: 6px 0 20px; font-size: 12.5px; }
html.afxs-auth .card { padding: 0; border: 0; background: none; box-shadow: none; }
html.afxs-auth .field { max-width: none; }
html.afxs-auth form .btn-primary { width: 100%; margin-top: 4px; }
html.afxs-auth .row { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--afx-border-default); }
html.afxs-auth .row .btn { width: 100%; }
html.afxs-auth #afx-email-switch-wrap { margin: 16px 0 0; text-align: center; font-size: 12px; }
html.afxs-auth .afx-auth-foot {
  display: block;
  margin: 14px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--afx-text-subtle);
}
.afx-auth-foot a { color: var(--afx-jade); text-decoration: none; font-weight: 500; }
.afx-auth-foot a:hover { text-decoration: underline; }

@media (max-width: 980px) {
  html.afxs-auth .afx-signin-stage { grid-template-columns: 1fr; }
  .afx-hero-word { font-size: 34px; }
}
@media (max-width: 720px) {
  .afx-shell { padding: 24px 16px 64px; }
  html.afxs-auth body { padding: 28px 16px; }
}
