:root {
  --bg: #0b0b0c;
  --bg-elevated: #161618;
  --bg-hover: #1e1e21;
  --border: #2a2a2e;
  --fg: #f2f2f3;
  --fg-muted: #9a9aa0;
  --accent: #0071e3;
  --accent-fg: #ffffff;
  --radius: 12px;
}

* { box-sizing: border-box; }

/* The UA's `[hidden] { display: none }` loses to any class that sets its own
   display (`.btn` is inline-flex), so a `hidden` button would still render.
   This makes the attribute mean what it says everywhere. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { opacity: 0.88; }

.btn-secondary { background: var(--bg-elevated); color: var(--fg); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }

.btn-large { padding: 14px 28px; font-size: 15px; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 11, 12, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--fg-muted);
}

.nav-links a:hover { color: var(--fg); }

.nav-cta { padding: 8px 16px; font-size: 13px; }

/* Hero */
.hero { padding: 96px 24px 72px; text-align: center; }

.hero-inner { max-width: 720px; margin: 0 auto; }

.hero h1 {
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  font-weight: 700;
}

.hero-sub {
  font-size: 18px;
  color: var(--fg-muted);
  margin: 0 0 32px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.hero-note { font-size: 13px; color: var(--fg-muted); }

/* Sections */
.section { padding: 72px 0; }
.section-alt { padding: 72px 0; background: var(--bg-elevated); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section h2 {
  font-size: 30px;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 12px;
}

.section-sub {
  text-align: center;
  color: var(--fg-muted);
  margin: 0 0 40px;
  font-size: 15px;
}

/* Value grid (3-up) */
.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.value-item h3 { font-size: 16px; margin: 0 0 8px; }
.value-item p { font-size: 14px; color: var(--fg-muted); margin: 0; }

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.feature-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.feature-card h3 { font-size: 15px; margin: 0 0 8px; }
.feature-card p { font-size: 13px; color: var(--fg-muted); margin: 0; }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
}

.price-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}

.price-card-featured { border-color: var(--accent); }

.price-badge {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.price-card h3 { font-size: 15px; margin: 0 0 8px; color: var(--fg-muted); }
.price { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.price-note { font-size: 13px; color: var(--fg-muted); margin: 0 0 20px; }

.price-card ul { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; }
.price-card li {
  font-size: 13px;
  padding-left: 20px;
  position: relative;
}
.price-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* CTA */
.cta-section { text-align: center; }
.cta-inner { max-width: 560px; }
.cta-inner h2 { margin-bottom: 12px; }
.cta-inner p { color: var(--fg-muted); margin: 0 0 28px; font-size: 15px; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 24px 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--fg-muted);
}

.cta-alt { margin: 16px 0 0; font-size: 13px; }
.cta-alt a { color: var(--fg-muted); text-decoration: underline; }
.cta-alt a:hover { color: var(--fg); }

/* Signup */
.signup-section { padding: 64px 24px 80px; }
.signup-shell {
  max-width: 460px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
}
.signup-title { font-size: 24px; margin: 0 0 8px; letter-spacing: -0.01em; }
.signup-sub { color: var(--fg-muted); font-size: 14px; margin: 0 0 28px; }
.signup-sub strong { color: var(--fg); }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s ease;
}
.field input:focus { outline: none; border-color: var(--accent); }
.field input::placeholder { color: var(--fg-muted); }
.field-hint { font-size: 12px; color: var(--fg-muted); margin: 6px 0 0; }
.field-error, .form-error { font-size: 12px; color: #ff6b6b; margin: 6px 0 0; }
.form-error { margin: 0 0 14px; }

.btn-block { width: 100%; }
.signup-fineprint {
  font-size: 12px;
  color: var(--fg-muted);
  margin: 16px 0 0;
  text-align: center;
}
.signup-fineprint a { color: var(--accent); }

.success-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 113, 227, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.key-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 28px;
}
.key-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin-bottom: 8px;
}
.key-value {
  display: block;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
  color: var(--fg);
  margin-bottom: 14px;
  line-height: 1.6;
}

.next-steps h2 { font-size: 15px; margin: 0 0 12px; }
.next-steps ol { margin: 0; padding-left: 20px; }
.next-steps li { font-size: 14px; color: var(--fg-muted); margin-bottom: 8px; }
.next-steps li strong { color: var(--fg); }
.next-steps code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.next-steps .signup-fineprint { text-align: left; margin-top: 16px; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 32px; }
  .value-grid, .feature-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 6px; text-align: center; }
  .signup-section { padding: 32px 16px 56px; }
  .signup-shell { padding: 28px 22px; }
  /* iOS Safari auto-zooms the page when a focused input's text is under
     16px, which yanks the layout around mid-signup. Bumping to 16px on
     small screens is the standard way to stop it. */
  .field input { font-size: 16px; }
}

/* Control (operator console) */
.console-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: 2px;
}
.console-section { padding: 40px 24px 80px; max-width: 900px; margin: 0 auto; }
.console-gate {
  max-width: 420px;
  margin: 40px auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.console-gate code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
}

.console-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.console-stat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.console-stat-value { font-size: 24px; font-weight: 600; }
.console-stat-label { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }

.console-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.console-panel h2 { font-size: 15px; margin: 0 0 4px; }
.console-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.console-panel-head h2 { margin: 0; }
.console-hint { font-size: 12px; color: var(--fg-muted); margin: 0 0 14px; }
.console-form-row { display: flex; gap: 8px; }
.console-form-row input {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.console-form-row input:focus { outline: none; border-color: var(--accent); }

.firm-row { border-bottom: 1px solid var(--border); }
.firm-row:last-child { border-bottom: 0; }
.firm-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; flex-wrap: wrap; }
.firm-toggle {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--fg); font: inherit; text-align: left; min-width: 0;
}
.firm-caret { color: var(--fg-muted); font-size: 11px; width: 10px; }
.firm-name { font-size: 14px; font-weight: 500; }
.firm-slug { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--fg-muted); }
.firm-meta { display: flex; align-items: center; gap: 10px; }
.firm-seats { font-size: 12px; color: var(--fg-muted); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; text-transform: lowercase; }
.pill-ok { background: rgba(48, 209, 88, 0.15); color: #4ade80; }
.pill-warn { background: rgba(255, 159, 10, 0.15); color: #fbbf24; }
.pill-bad { background: rgba(255, 69, 58, 0.15); color: #f87171; }
.pill-muted { background: var(--bg-hover); color: var(--fg-muted); }

.firm-users { padding: 4px 0 14px 20px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; flex-wrap: wrap; }
.user-initials {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0, 113, 227, 0.15); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; flex-shrink: 0;
}
.user-name { font-weight: 500; }
.user-email { color: var(--fg-muted); }

.audit-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.audit-row:last-child { border-bottom: 0; }
.audit-action { font-weight: 500; }
.audit-detail { color: var(--fg-muted); flex: 1; min-width: 0; }
.audit-time { color: var(--fg-muted); font-size: 11px; }

@media (max-width: 720px) {
  .console-stats { grid-template-columns: repeat(2, 1fr); }
  .console-gate { padding: 24px 20px; }
}
