/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img, svg { display: block; max-width: 100%; }

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --brand:       #4F46E5;
  --brand-dark:  #3730A3;
  --brand-light: #EEF2FF;
  --text:        #111827;
  --muted:       #6B7280;
  --border:      #E5E7EB;
  --surface:     #F9FAFB;
  --white:       #FFFFFF;
  --radius:      0.5rem;
  --shadow:      0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

/* ─── Base typography ────────────────────────────────────── */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 .75rem;
}

p { margin: 0 0 1rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Utility ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.btn {
  display: inline-block;
  padding: .625rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  text-decoration: none;
  border: 2px solid transparent;
  line-height: 1.4;
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--brand-dark);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border-color: var(--brand);
  color: var(--brand);
}
.btn-outline:hover {
  background: var(--brand-light);
  text-decoration: none;
}

.btn--full {
  width: 100%;
  text-align: center;
}

/* ─── Marketing nav ──────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: .875rem;
}

.nav-logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.nav-logo span { color: var(--brand); }
.nav-logo:hover { text-decoration: none; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.nav-signin {
  font-size: .9375rem;
  font-weight: 500;
  color: var(--muted);
}
.nav-signin:hover { color: var(--text); text-decoration: none; }

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  padding-block: 6rem 5rem;
  text-align: center;
  background: linear-gradient(160deg, var(--brand-light) 0%, var(--white) 60%);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -.02em;
  max-width: 18ch;
  margin-inline: auto;
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 48ch;
  margin-inline: auto;
  margin-bottom: 2rem;
}

.hero-cta { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.hero-note {
  margin-top: .875rem;
  font-size: .875rem;
  color: var(--muted);
  margin-bottom: 0;
}

/* ─── Promises strip ─────────────────────────────────────── */
.promises {
  padding-block: 3.5rem;
  background: var(--brand);
  color: var(--white);
}

.promises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
}

.promise-item strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .25rem;
}

.promise-item span {
  font-size: .875rem;
  opacity: .85;
}

/* ─── Section shared ─────────────────────────────────────── */
.section {
  padding-block: 5rem;
}

.section-alt {
  background: var(--surface);
}

.section-label {
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: .5rem;
}

.section-heading {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -.02em;
  margin-bottom: 1rem;
}

.section-sub {
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 0;
}

.section-sub--centered {
  margin-left: auto;
  margin-right: auto;
}

/* ─── Callout card ───────────────────────────────────────── */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: 1.5rem;
  margin: 2rem 0;
}

.callout p {
  font-size: .875rem;
  color: var(--muted);
  margin: 0;
}

/* ─── Form fields ────────────────────────────────────────── */
.form-field {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: .375rem;
}

.form-input {
  width: 100%;
  padding: .625rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
}

textarea.form-input {
  resize: vertical;
  min-height: 5rem;
}

input[type="file"]::file-selector-button {
  padding: .375rem .75rem;
  border-radius: var(--radius);
  border: 2px solid var(--brand);
  background: transparent;
  color: var(--brand);
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
  margin-right: .75rem;
}

input[type="file"]::file-selector-button:hover {
  background: var(--brand-light);
}

@media (prefers-color-scheme: dark) {
  input[type="file"]::file-selector-button:hover {
    background: #1E1B4B;
  }
}

.form-input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px white inset;
  -webkit-text-fill-color: var(--text);
}

@media (prefers-color-scheme: dark) {
  .form-input:-webkit-autofill,
  .form-input:-webkit-autofill:hover,
  .form-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #1F2937 inset;
    -webkit-text-fill-color: #F9FAFB;
  }
}

.field-error {
  font-size: .875rem;
  color: #DC2626;
  display: block;
  margin-top: .25rem;
}

/* ─── Page contact line ──────────────────────────────────── */
.page-contact {
  font-size: .875rem;
  color: var(--muted);
  text-align: center;
  margin-top: 1.5rem;
}

/* ─── How it works ───────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  font-weight: 700;
  font-size: .9375rem;
  margin-bottom: .875rem;
}

.step h3 {
  font-size: 1.0625rem;
  margin-bottom: .375rem;
}

.step p {
  font-size: .9375rem;
  color: var(--muted);
  margin-bottom: 0;
}

/* ─── Pricing ────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
  align-items: start;
}

/* Force exactly 3 columns on wide screens; falls back to auto-fit on narrow */
.pricing-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 860px) {
  .pricing-grid--3col {
    grid-template-columns: 1fr;
  }
}

.pricing-card {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 2rem;
  background: var(--white);
  box-shadow: var(--shadow);
}

.pricing-card.featured {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand), var(--shadow-md);
}

.pricing-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--brand);
  color: var(--white);
  padding: .2rem .6rem;
  border-radius: 999px;
  margin-bottom: .875rem;
}

.pricing-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: .375rem;
}

.pricing-price {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  margin-bottom: .25rem;
}

.pricing-price sup {
  font-size: 1.125rem;
  font-weight: 600;
  vertical-align: top;
  margin-top: .375rem;
}

.pricing-period {
  font-size: .875rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.pricing-annual {
  font-size: .8125rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
}

.pricing-features li {
  font-size: .9375rem;
  padding: .375rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.pricing-features li:last-child { border-bottom: none; }

.pricing-features li::before {
  content: "✓";
  color: var(--brand);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: .05em;
}

/* ─── Dark mode ─────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    /* Shift brand to indigo-400 — the original is too dark to read on dark bg */
    --brand:       #818CF8;
    --brand-dark:  #6366F1;
    --brand-light: #1E1B4B;
    --text:        #F9FAFB;
    --muted:       #9CA3AF;
    --border:      #374151;
    --surface:     #1F2937;
    /* --white stays #FFFFFF — used for text on brand-coloured surfaces */
    --shadow:      0 1px 3px rgba(0,0,0,.4),  0 1px 2px rgba(0,0,0,.3);
    --shadow-md:   0 4px 6px rgba(0,0,0,.4),  0 2px 4px rgba(0,0,0,.3);
  }

  /* Body bg — can't use --white here, that must stay white */
  body { background-color: #111827; }

  /* Nav frosted-glass needs a dark base */
  .nav { background: rgba(17, 24, 39, 0.92); }

  /* Hero gradient — uses --brand-light so it updates with the active theme */
  .hero { background: linear-gradient(160deg, var(--brand-light) 0%, #111827 60%); }

  /* Cards sit on gray-800, one step lighter than the body */
  .pricing-card { background: #1F2937; }

  /* Outline button: brand colour shifts, hover needs a dark fill */
  .btn-outline:hover { background: var(--brand-light); }

  /* Featured card ring still uses the (now lighter) brand token */
  .pricing-card.featured {
    box-shadow: 0 0 0 2px var(--brand), var(--shadow-md);
  }
}

/* ─── Themes ─────────────────────────────────────────────── */
/* Light mode overrides per theme */
[data-theme="plum"] {
  --brand:       #7E22CE;
  --brand-dark:  #6B21A8;
  --brand-light: #F5F3FF;
}

[data-theme="forest"] {
  --brand:       #166534;
  --brand-dark:  #14532D;
  --brand-light: #F0FDF4;
}

[data-theme="charcoal"] {
  --brand:       #1E293B;
  --brand-dark:  #0F172A;
  --brand-light: #F1F5F9;
}

[data-theme="mauve"] {
  --brand:       #8B4F6E;
  --brand-dark:  #6D3A55;
  --brand-light: #FDF2F8;
}

[data-theme="steel"] {
  --brand:       #1B6CA8;
  --brand-dark:  #155A8A;
  --brand-light: #EBF5FB;
}

/* Dark mode overrides per theme.
   Goal: light enough to contrast against dark backgrounds, but hue-stable —
   sRGB lightening shifts perceived color (purple → pink, forest → mint) so
   we pick mid-tone values that stay true to the theme personality. */
@media (prefers-color-scheme: dark) {
  [data-theme="plum"] {
    /* violet-400 — reads as definitive purple, not lavender-pink */
    --brand:       #A78BFA;
    --brand-dark:  #7C3AED;
    --brand-light: #2E1065;
  }

  [data-theme="forest"] {
    /* deep forest green with just enough lift for outlines/text on dark backgrounds */
    --brand:       #1A8A43;
    --brand-dark:  #166534;
    --brand-light: #052E16;
  }

  [data-theme="charcoal"] {
    /* slate — charcoal looks great in dark mode as-is, keep it */
    --brand:       #CBD5E1;
    --brand-dark:  #94A3B8;
    --brand-light: #1E293B;
  }

  [data-theme="mauve"] {
    /* muted dusty rose — stays in the wine/rose family, not hot pink */
    --brand:       #C47A96;
    --brand-dark:  #A8607D;
    --brand-light: #3D1120;
  }

  [data-theme="steel"] {
    /* cornflower blue — deeper and more professional than icy sky blue */
    --brand:       #6EA8D8;
    --brand-dark:  #4A8EC4;
    --brand-light: #0F2942;
  }
}

/* ─── Theme switcher ─────────────────────────────────────── */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: .3125rem;
  padding: .3125rem .5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-left: 1rem;
}

.theme-swatch {
  width: .875rem;
  height: .875rem;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform .15s, box-shadow .15s;
  flex-shrink: 0;
}

.theme-swatch:hover {
  transform: scale(1.25);
}

.theme-swatch--active {
  box-shadow: 0 0 0 2px var(--white), 0 0 0 3.5px currentColor;
}

/* ─── Trial banner ───────────────────────────────────────── */
.trial-banner {
  background: var(--brand);
  color: var(--white);
  text-align: center;
  padding: .5rem 1rem;
  font-size: .875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.trial-banner a {
  color: var(--white);
  font-weight: 600;
  text-decoration: underline;
}
.trial-banner a:hover { opacity: .85; text-decoration: none; }

@media (prefers-color-scheme: dark) {
  .trial-banner { background: var(--brand-dark); }
}

/* ─── Dashboard nav ─────────────────────────────────────── */
.dash-nav {
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.dash-nav-inner {
  display: flex;
  align-items: center;
  gap: .25rem;
  padding-block: .5rem;
}

.dash-nav-link {
  padding: .375rem .75rem;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, background .15s;
}

.dash-nav-link:hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.dash-nav-link--active {
  color: var(--text);
  background: var(--surface);
}

.dash-nav-end {
  margin-left: auto;
}

@media (prefers-color-scheme: dark) {
  .dash-nav { background: #111827; }
  .dash-nav-link:hover,
  .dash-nav-link--active { background: #1F2937; }

  .form-input {
    background: #1F2937;
    border-color: var(--border);
    color: var(--text);
  }

  select.form-input {
    background: #1F2937;
    color: var(--text);
  }
}

/* ─── Dashboard layout ───────────────────────────────────── */
.dash-main {
  padding-block: 2.5rem;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.dash-header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.dash-section {
  margin-bottom: 2.5rem;
}

.dash-section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 1rem;
}

.dash-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 1rem;
}

/* ─── Waitlist entry ─────────────────────────────────────── */
.waitlist-entry {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9375rem;
  flex-wrap: wrap;
}

.waitlist-entry:last-child {
  border-bottom: none;
}

.waitlist-entry__position {
  font-weight: 700;
  color: var(--muted);
  min-width: 2rem;
}

.waitlist-entry__name { font-weight: 600; }

.waitlist-entry__email,
.waitlist-entry__phone,
.waitlist-entry__joined {
  color: var(--muted);
  font-size: .875rem;
}

.waitlist-entry__actions {
  margin-left: auto;
  display: flex;
  gap: .5rem;
}

/* ─── Alert ──────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .9375rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
}

.alert-success {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #166534;
}

@media (prefers-color-scheme: dark) {
  .alert-success {
    background: #052e16;
    border-color: #166534;
    color: #86efac;
  }
}

/* ─── Dashboard table ────────────────────────────────────── */
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
}

.dash-table th {
  text-align: left;
  font-size: .8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: .625rem .75rem;
  border-bottom: 2px solid var(--border);
}

.dash-table td {
  padding: .75rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.dash-table tr:last-child td {
  border-bottom: none;
}

/* ─── Button variants ────────────────────────────────────── */
.btn-sm {
  padding: .3125rem .625rem;
  font-size: .8125rem;
}

.btn-danger {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-danger:hover {
  background: transparent;
  border-color: transparent;
  color: #DC2626;
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  .btn-danger:hover { color: #FCA5A5; }
}

/* ─── Branding preview ───────────────────────────────────── */
.branding-preview {
  padding: 1.5rem;
  border-radius: calc(var(--radius) * 1.5);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 1.5rem;
}

/* ─── Participant footer (powered-by attribution) ────────── */
.participant-footer {
  margin-top: 3rem;
  padding-block: 1.25rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.participant-footer-link {
  font-size: .8125rem;
  color: var(--muted);
  letter-spacing: .01em;
}

.participant-footer-link:hover {
  color: var(--brand);
  text-decoration: none;
}

/* ─── Template grid ─────────────────────────────────────── */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.template-card {
  display: block;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  text-decoration: none;
}

.template-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
  text-decoration: none;
}

.template-card-name {
  font-weight: 600;
  font-size: .9375rem;
  color: var(--text);
  margin-bottom: .3rem;
}

.template-card-tagline {
  font-size: .8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.template-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.template-preview-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .75rem;
}

@media (prefers-color-scheme: dark) {
  .template-card { background: #1F2937; }
}

/* ─── Dashboard signup list ─────────────────────────────── */
.signup-slug-link {
  display: block;
  font-size: .8125rem;
  color: var(--muted);
  margin-top: .2rem;
}

.signup-slug-link:hover {
  color: var(--brand);
  text-decoration: none;
}

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .875rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a { color: var(--muted); }

/* ─── Upgrade prompts ───────────────────────────────────── */
.upgrade-prompt {
  background: var(--brand-light);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.upgrade-prompt-message {
  font-size: .9375rem;
  color: var(--text);
  margin: 0 0 .875rem;
}

.upgrade-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

@media (prefers-color-scheme: dark) {
  .upgrade-prompt {
    background: rgba(79, 70, 229, .12);
    border-color: rgba(79, 70, 229, .45);
  }
  .upgrade-prompt-message { color: #E5E7EB; }
}
.footer-links a:hover { color: var(--text); text-decoration: none; }
