/* Reversal Email — shared UI. Theme tokens + shell + components. Mobile-first.
   All colors via variables (light + dark). WCAG-aware contrast. No per-page hex. */
:root {
  --re-bg: #eef3fb;
  --re-surface: #ffffff;
  --re-surface-2: #f5f8fd;
  --re-border: #d9e3f2;
  --re-text: #0c1f3f;
  --re-text-muted: #52607a;
  /* Brand palette sampled from the Reversal Email mark (navy -> azure). */
  --re-primary: #1f6fe0;
  --re-primary-ink: #ffffff;
  --re-accent: #0e2a54;
  --re-cyan: #38b6ff;
  --re-gradient: linear-gradient(135deg, #0e2a54 0%, #1f6fe0 55%, #38b6ff 100%);
  --re-success: #16a34a;
  --re-danger: #dc2626;
  --re-warning: #d97706;
  --re-radius: 12px;
  --re-shadow: 0 1px 3px rgba(14,42,84,.10), 0 1px 2px rgba(14,42,84,.05);
  --re-sidebar-w: 250px;
  --re-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --re-nav-bg: rgba(255, 255, 255, .82);
  --re-hero-glow-1: rgba(56, 182, 255, .16);
  --re-hero-glow-2: rgba(31, 111, 224, .12);
  --re-tint: rgba(31, 111, 224, .10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --re-bg: #070d1c;
    --re-surface: #0f1830;
    --re-surface-2: #16223f;
    --re-border: #27365a;
    --re-text: #eef2fb;
    --re-text-muted: #a3b0cc;
    --re-primary: #3a8bf0;
    --re-accent: #4aa3ff;
    --re-shadow: 0 1px 3px rgba(0,0,0,.5);
    --re-nav-bg: rgba(7, 13, 28, .82);
    --re-hero-glow-1: rgba(56, 182, 255, .10);
    --re-hero-glow-2: rgba(31, 111, 224, .12);
    --re-tint: rgba(74, 163, 255, .14);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--re-font);
  background: var(--re-bg);
  color: var(--re-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--re-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1rem; color: var(--re-text-muted); }

/* Buttons */
.re-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem 1rem; border-radius: 10px; border: 1px solid var(--re-border);
  background: var(--re-surface); color: var(--re-text); font-weight: 600;
  cursor: pointer; font-size: .95rem; min-height: 44px; transition: .15s;
}
.re-btn:hover { text-decoration: none; border-color: var(--re-primary); }
.re-btn--primary { background: var(--re-gradient); color: var(--re-primary-ink); border-color: transparent; box-shadow: 0 2px 8px rgba(31,111,224,.28); }
.re-btn--primary:hover { filter: brightness(1.05); }
.re-btn--ghost { background: transparent; }
.re-btn--sm { padding: .35rem .7rem; min-height: 34px; font-size: .85rem; }
.re-btn--lg { padding: .8rem 1.5rem; min-height: 50px; font-size: 1rem; border-radius: 12px; }
.re-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Cards */
.re-card {
  background: var(--re-surface); border: 1px solid var(--re-border);
  border-radius: var(--re-radius); box-shadow: var(--re-shadow); padding: 1.25rem;
}
.re-card + .re-card { margin-top: 1rem; }
.re-card--center { text-align: center; max-width: 480px; margin: 4rem auto; }
.re-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* Stat tiles */
.re-stat { padding: 1.1rem; }
.re-stat b { font-size: 1.8rem; display: block; color: var(--re-text); }
.re-stat span { color: var(--re-text-muted); font-size: .85rem; }

/* Shell */
.re-shell { display: grid; grid-template-columns: var(--re-sidebar-w) 1fr; min-height: 100vh; }
.re-sidebar {
  background: var(--re-surface); border-right: 1px solid var(--re-border);
  padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.re-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; padding: .5rem .6rem 1rem; color: var(--re-text); }
.re-brand .dot { width: 12px; height: 12px; border-radius: 3px; background: var(--re-gradient); }
.re-logo { display: block; height: 54px; width: auto; max-width: 100%; }
.re-logo--lg { height: 96px; margin: 0 auto .5rem; }
.re-nav a {
  display: flex; align-items: center; gap: .6rem; padding: .7rem .75rem; border-radius: 9px;
  color: var(--re-text-muted); font-weight: 600; margin-bottom: 2px;
}
.re-nav a:hover { background: var(--re-surface-2); color: var(--re-text); text-decoration: none; }
.re-nav a.active { background: var(--re-gradient); color: var(--re-primary-ink); box-shadow: 0 2px 8px rgba(31,111,224,.28); }
.re-col { display: flex; flex-direction: column; min-width: 0; }
.re-header {
  display: flex; align-items: center; gap: 1rem; padding: .9rem 1.25rem;
  background: var(--re-surface); border-bottom: 1px solid var(--re-border); position: sticky; top: 0; z-index: 20;
}
.re-header h1 { font-size: 1.2rem; margin: 0; }
.re-header .spacer { flex: 1; }
.re-burger { display: none; background: none; border: 1px solid var(--re-border); border-radius: 8px; width: 42px; height: 42px; font-size: 1.2rem; cursor: pointer; color: var(--re-text); }
.re-main { padding: 1.25rem; max-width: 1200px; width: 100%; }
.re-shell-narrow { max-width: 620px; margin: 0 auto; padding: 1.25rem; }

/* Tables */
.re-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.re-table th, .re-table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--re-border); }
.re-table th { color: var(--re-text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.re-table-wrap { overflow-x: auto; }
.re-setup-compare td:first-child { min-width: 9rem; }
.re-setup-option { border: 1px solid var(--re-border); transition: border-color .15s, box-shadow .15s; }
.re-setup-option--suggested { border-color: rgba(31,111,224,.35); }
.re-setup-option--active,
.re-setup-option:has(input:checked) { border-color: var(--re-primary, #1f6fe0); box-shadow: 0 0 0 1px rgba(31,111,224,.25); }

/* Forms */
.re-field { margin-bottom: 1rem; }
.re-field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .9rem; }
.re-input, .re-select, .re-textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--re-border); border-radius: 9px;
  background: var(--re-surface-2); color: var(--re-text); font: inherit; min-height: 44px;
}
.re-input::placeholder { color: var(--re-text-muted); }
.re-textarea { min-height: 140px; resize: vertical; }

/* Badges */
.re-badge { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--re-surface-2); color: var(--re-text-muted); border: 1px solid var(--re-border); }
.re-badge--ok { color: var(--re-success); border-color: var(--re-success); }
.re-badge--warn { color: var(--re-warning); border-color: var(--re-warning); }
.re-badge--bad { color: var(--re-danger); border-color: var(--re-danger); }

.re-flash { padding: .8rem 1rem; border-radius: 9px; margin-bottom: 1rem; border: 1px solid var(--re-border); background: var(--re-surface-2); }
.re-muted { color: var(--re-text-muted); }
.re-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

/* Mobile */
.re-overlay { display: none; }
@media (max-width: 860px) {
  .re-shell { grid-template-columns: 1fr; }
  .re-sidebar {
    position: fixed; z-index: 40; left: 0; top: 0; width: 82%; max-width: 300px;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  body.re-drawer-open .re-sidebar { transform: translateX(0); }
  body.re-drawer-open .re-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; }
  .re-burger { display: inline-flex; align-items: center; justify-content: center; }
}

/* ============================================================
   Landing page (public marketing site)
   ============================================================ */
.lp { display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
.lp-container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }

/* Top nav */
.lp-nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--re-nav-bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--re-border);
}
.lp-nav-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.lp-brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--re-text); }
.lp-brand img { height: 40px; width: auto; display: block; }
.lp-brand:hover { text-decoration: none; }
.lp-nav-links { display: flex; gap: 1.4rem; margin-left: auto; }
.lp-nav-links a { color: var(--re-text-muted); font-weight: 600; font-size: .92rem; }
.lp-nav-links a:hover { color: var(--re-text); text-decoration: none; }
.lp-nav-cta { display: flex; gap: .6rem; align-items: center; }

/* Hero */
.lp-hero {
  position: relative; overflow: hidden;
  padding: 4.5rem 0 5rem;
  background:
    radial-gradient(700px 420px at 12% -10%, var(--re-hero-glow-1), transparent 70%),
    radial-gradient(700px 460px at 95% 10%, var(--re-hero-glow-2), transparent 70%);
}
.lp-hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3.5rem; align-items: center; }
.lp-eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1.1rem;
  background: var(--re-tint); color: var(--re-primary);
  font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.lp-hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.15rem);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.12; margin-bottom: 1rem;
}
.lp-hero h1 em { font-style: normal; background: var(--re-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-hero-sub { font-size: 1.12rem; max-width: 34rem; margin-bottom: 1.75rem; }
.lp-hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.lp-hero-note { font-size: .85rem; color: var(--re-text-muted); margin: 0; }

/* Hero mock panel */
.lp-mock { position: relative; width: 100%; max-width: 480px; overflow: visible; }
.lp-mock-card {
  background: var(--re-surface); border: 1px solid var(--re-border);
  border-radius: 16px; box-shadow: 0 18px 44px rgba(14,42,84,.16); overflow: visible;
}
.lp-mock-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .95rem 1.15rem; border-bottom: 1px solid var(--re-border); background: var(--re-surface-2);
}
.lp-mock-head b { font-size: .95rem; }
.lp-mock-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1.15rem; border-bottom: 1px solid var(--re-border); font-size: .9rem;
}
.lp-mock-row:last-child { border-bottom: 0; }
.lp-mock-row .who { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.lp-mock-row .who span { color: var(--re-text-muted); font-size: .8rem; display: block; }
.lp-mock-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--re-gradient); color: #fff; font-weight: 700; font-size: .8rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.lp-mock-float {
  position: absolute; right: -0.5rem; bottom: -0.8rem;
  background: var(--re-surface); border: 1px solid var(--re-border);
  border-radius: 12px; box-shadow: var(--re-shadow);
  padding: .7rem .95rem; font-size: .85rem; font-weight: 600;
  display: flex; align-items: center; gap: .55rem;
}
.lp-mock-float .re-badge { flex: none; }

/* Sections */
.lp-section { padding: 4.5rem 0; }
.lp-section--alt { background: var(--re-surface); border-top: 1px solid var(--re-border); border-bottom: 1px solid var(--re-border); }
.lp-section-head { max-width: 40rem; margin: 0 auto 2.75rem; text-align: center; }
.lp-section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.015em; }
.lp-section-head p { font-size: 1.02rem; margin: 0; }

/* Feature grid */
.lp-features { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.lp-feature { padding: 1.5rem; transition: transform .15s, box-shadow .15s; }
.lp-feature:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(14,42,84,.12); }
.lp-feature h3 { font-size: 1.02rem; margin: .9rem 0 .35rem; }
.lp-feature p { font-size: .92rem; margin: 0; }
.lp-feature-icon {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--re-tint); color: var(--re-primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.lp-feature-icon svg { width: 22px; height: 22px; }

/* How it works */
.lp-steps { display: grid; gap: 2rem; grid-template-columns: repeat(3, 1fr); counter-reset: lp-step; }
.lp-step { text-align: center; padding: 0 .5rem; }
.lp-step-num {
  counter-increment: lp-step;
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 1rem;
  background: var(--re-gradient); color: var(--re-primary-ink);
  font-weight: 800; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(31,111,224,.3);
}
.lp-step-num::before { content: counter(lp-step); }
.lp-step h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.lp-step p { font-size: .92rem; margin: 0; }

/* Pricing */
.lp-price-card { max-width: 420px; margin: 0 auto; padding: 2rem; text-align: center; position: relative; border-color: var(--re-primary); box-shadow: 0 12px 36px rgba(31,111,224,.14); }
.lp-price-card .re-badge { position: absolute; top: -0.8rem; left: 50%; transform: translateX(-50%); background: var(--re-gradient); color: var(--re-primary-ink); border: 0; padding: .3rem .9rem; }
.lp-price { font-size: 3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; margin: .75rem 0 .15rem; }
.lp-price small { font-size: 1rem; font-weight: 600; color: var(--re-text-muted); letter-spacing: 0; }
.lp-price-list { list-style: none; margin: 1.4rem 0 1.6rem; padding: 0; text-align: left; }
.lp-price-list li { display: flex; align-items: flex-start; gap: .6rem; padding: .42rem 0; font-size: .93rem; color: var(--re-text); }
.lp-price-list svg { width: 18px; height: 18px; flex: none; margin-top: .18rem; color: var(--re-success); }

/* CTA band */
.lp-cta-band { background: var(--re-gradient); padding: 4rem 0; text-align: center; }
.lp-cta-band h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.015em; }
.lp-cta-band p { color: rgba(255,255,255,.85); max-width: 36rem; margin: 0 auto 1.75rem; }
.lp-cta-band .re-btn { background: #fff; color: var(--re-accent); border: 0; }
@media (prefers-color-scheme: dark) { .lp-cta-band .re-btn { color: #0e2a54; } }

/* Footer */
.lp-footer { border-top: 1px solid var(--re-border); padding: 2rem 0; margin-top: auto; }
.lp-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .87rem; color: var(--re-text-muted); }
.lp-footer a { color: var(--re-text-muted); }
.lp-footer a:hover { color: var(--re-text); }

/* Landing responsive */
@media (max-width: 940px) {
  .lp-hero { padding: 3rem 0 3.5rem; }
  .lp-hero-inner { grid-template-columns: 1fr; gap: 2.75rem; }
  .lp-mock { max-width: 480px; }
  .lp-mock-float { right: .5rem; }
  .lp-steps { grid-template-columns: 1fr; max-width: 26rem; margin: 0 auto; }
}
@media (max-width: 700px) {
  .lp-nav-links { display: none; }
  .lp-nav-cta .re-btn--ghost { display: none; }
  .lp-section { padding: 3rem 0; }
  .lp-hero-cta .re-btn { width: 100%; }
}
