/* ============================================================================
   HIDDEN ACE — Design System
   ============================================================================
   Token-driven dark theme extending the product's own in-app palette
   (signal green on near-black) into a full marketing/docs/account system.
   ========================================================================= */

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

:root {
  /* ---- Color: surfaces ---- */
  --bg:           #0a0a0a;
  --surface:      #111111;
  --surface-2:    #161616;
  --surface-3:    #1c1c1c;
  --border:       #232323;
  --border-soft:  #1a1a1a;

  /* ---- Color: signal (the app's own accent, carried through) ---- */
  --green:        #ca3d3d;
  --green-dim:    #6e2121;
  --green-bright: #d43b3b;
  --green-glow:   rgba(219, 86, 86, 0.18);
  --green-glow-strong: rgba(255, 79, 79, 0.32);

  /* ---- Color: text ---- */
  --text:         #ededed;
  --text-dim:     #9a9a9a;
  --text-faint:   #5e5e5e;

  /* ---- Color: state ---- */
  --danger:       #e0524f;
  --danger-dim:   #3a1818;
  --amber:        #e8a33a;
  --amber-dim:    #3a2c10;

  /* ---- Color: card-table felt (sparing use — diagrams/illustrations only) ---- */
  --felt:         #0d2818;
  --chip-blue:    #4a90d9;

  /* ---- Type ---- */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* ---- Geometry ---- */
  --radius-sm:    8px;
  --radius:       14px;
  --radius-lg:    22px;
  --radius-pill:  999px;

  /* ---- Layout ---- */
  --wrap:         1160px;
  --wrap-narrow:  760px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --speed-fast: 150ms;
  --speed: 280ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --speed-fast: 0ms; --speed: 0ms; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ============================================================================
   RESET & BASE
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: #fff;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p { margin: 0; color: var(--text-dim); }

::selection { background: var(--green-glow-strong); color: #fff; }

/* Visible keyboard focus everywhere, including for custom components. */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}
a:focus-visible, button:focus-visible { outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--green);
  color: #000;
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  font-weight: 700;
  z-index: 999;
}
.skip-link:focus { left: 0; }

/* ============================================================================
   LAYOUT PRIMITIVES
   ========================================================================= */

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap-narrow {
  max-width: var(--wrap-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 100px 0; }
.section-tight { padding: 64px 0; }
@media (max-width: 720px) {
  .section { padding: 64px 0; }
  .section-tight { padding: 44px 0; }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-glow);
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}
.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
}
.section-head p {
  margin-top: 14px;
  font-size: 17px;
  color: var(--text-dim);
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ============================================================================
   BUTTONS
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--speed-fast) var(--ease), background var(--speed-fast), border-color var(--speed-fast), box-shadow var(--speed-fast);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--green);
  color: #06210f;
  box-shadow: 0 0 0 1px var(--green-dim), 0 8px 24px -8px var(--green-glow-strong);
}
.btn-primary:hover { background: var(--green-bright); box-shadow: 0 0 0 1px var(--green-dim), 0 10px 30px -6px var(--green-glow-strong); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-3); border-color: #333; }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: #3a3a3a; }

.btn-lg { padding: 16px 30px; font-size: 16px; }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ============================================================================
   HEADER / NAV
   ========================================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 60px; height: 60px; border-radius: 7px; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.header-nav a:not(.btn) {
  color: var(--text-dim);
  font-size: 14.5px;
  font-weight: 500;
}
.header-nav a:not(.btn):hover { color: var(--text); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 880px) {
  .header-nav { display: none; }
  .header-nav.nav-open {
    display: flex;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    gap: 16px;
  }
  .nav-toggle { display: block; }
}

.inline-form { display: contents; }

/* ============================================================================
   CARDS
   ========================================================================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ============================================================================
   FOOTER
   ========================================================================= */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 56px 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 12px;
}
.footer-tagline { font-size: 14px; max-width: 240px; }
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 16px;
  font-weight: 700;
}
.footer-col a {
  display: block;
  color: var(--text-dim);
  font-size: 14.5px;
  margin-bottom: 12px;
}
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-faint);
}
.footer-disclaimer {
  margin-top: 28px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.6;
}

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   UTILITY
   ========================================================================= */

.mono { font-family: var(--font-mono); }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-green { color: var(--green); }
.center { text-align: center; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot-live { background: var(--green); box-shadow: 0 0 0 4px var(--green-glow); }
.status-dot-off { background: var(--text-faint); }
.status-dot-warn { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-dim); }

.pill {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill-succeeded { background: var(--green-glow); color: var(--green-bright); }
.pill-failed, .pill-disputed { background: var(--danger-dim); color: var(--danger); }
.pill-refunded { background: var(--amber-dim); color: var(--amber); }

.banner {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  margin-bottom: 28px;
}
.banner-success { background: var(--green-glow); border: 1px solid var(--green-dim); color: #d7f7e3; }
.banner-warn { background: var(--amber-dim); border: 1px solid #5a4318; color: #ffe1ad; }
.banner-error { background: var(--danger-dim); border: 1px solid #6b2424; color: #ffd4d2; }

/* ============================================================================
   FORMS (auth pages, account pages)
   ========================================================================= */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}
.auth-logo img { width: 32px; height: 32px; border-radius: 8px; }
.auth-logo span { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: #fff; }
.auth-card h1 {
  font-size: 24px;
  text-align: center;
  margin-bottom: 6px;
}
.auth-sub {
  text-align: center;
  font-size: 14px;
  margin-bottom: 28px;
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-body);
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--speed-fast);
}
.field input:focus { border-color: var(--green); }
.field-hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }

.form-msg { font-size: 14px; margin-top: 14px; min-height: 1px; }
.form-msg-error { color: var(--danger); }
.form-msg-success { color: var(--green-bright); }

.auth-footer-link {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--text-dim);
}

.divider-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-faint);
  font-size: 13px;
}
.divider-or::before, .divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #fff;
  color: #1f1f1f;
  font-weight: 600;
  font-size: 14.5px;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid #ddd;
}
.btn-google:hover { background: #f5f5f5; text-decoration: none; }

/* ============================================================================
   ACCOUNT / DASHBOARD
   ========================================================================= */

.dash-body-tag { background: var(--bg); }
.dash-main { padding: 48px 24px 80px; max-width: 720px; }
.back-link { font-size: 14px; color: var(--text-dim); display: inline-block; margin-bottom: 18px; }
.dash-greeting { font-size: 28px; margin-bottom: 28px; }
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
}
.dash-card-primary { border-color: var(--green-dim); box-shadow: 0 0 0 1px var(--green-glow) inset; }
.dash-card-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.dash-status-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.dash-status-text { font-weight: 600; color: #fff; }
.dash-card-sub { font-size: 14.5px; margin-top: 6px; margin-bottom: 18px; line-height: 1.6; }
.dash-card-sub:last-child { margin-bottom: 0; }
.dash-warn { color: var(--amber); }
.dash-launch { margin-top: 4px; }

.billing-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.billing-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.billing-table td { padding: 10px 0; border-bottom: 1px solid var(--border-soft); color: var(--text); }
.billing-table tr:last-child td { border-bottom: none; }
