/* ============================================================
   ChorifIQ — Shared Design System
   Design tokens mirror supabase/functions/_shared/email_templates.ts

   Background:  #f0f4f8   Navy primary:  #203753   Gold accent:  #d68f3e
   Heading:     #1a2d42   Body text:     #4a5568   Success:      #22a35a
   Light text:  #94a3b8   Divider:       #e8ecf0   Amber tint:   #fffbf5
   ============================================================ */

:root {
  --navy:       #203753;
  --navy-dark:  #1a2d42;
  --gold:       #d68f3e;
  --gold-dark:  #b87a35;
  --bg:         #f0f4f8;
  --surface:    #ffffff;
  --text:       #4a5568;
  --heading:    #1a2d42;
  --muted:      #94a3b8;
  --divider:    #e8ecf0;
  --amber-tint: #fffbf5;
  --amber-text: #7a5c2e;
  --success:    #22a35a;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--gold); }
a:hover { color: var(--gold-dark); }

/* ── Site header ── */
.site-header {
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.5vw, 18px) clamp(16px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header-logo img {
  height: clamp(48px, 7.5vw, 96px);
  width: auto;
  display: block;
}
.site-header-spacer {
  flex: 1;
}
.site-header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 2vw, 28px);
  flex: 1;
  flex-wrap: wrap;
}
.site-header-nav a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s;
}
.site-header-nav a:hover {
  color: var(--gold);
}

/* ── Card (action pages: verify, join) ── */
.card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  overflow: hidden;
  width: 100%;
  max-width: 480px;
  margin: 40px auto;
}
.card-logo {
  background: var(--surface);
  padding: 28px 40px 20px;
  text-align: center;
  border-bottom: 5px solid var(--gold);
}
.card-logo img {
  display: block;
  margin: 0 auto;
  max-width: 400px;
  height: auto;
}
.card-body {
  padding: 36px 40px 28px;
  text-align: center;
}
.card-footer-row {
  padding: 16px 40px 24px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--divider);
}

/* ── Badge icon (circular, used above headings) ── */
.badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
}
.badge-success { background: var(--success); }

/* ── Typography ── */
h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 0.5rem;
}
h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 0.5rem;
}
h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin: 1rem 0 0.4rem;
}
p { margin: 0.5rem 0 1rem; }

/* ── Buttons ── */
.btn {
  display: block;
  width: 100%;
  padding: 0.875rem 1rem;
  margin: 0.6rem 0;
  text-align: center;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
  box-sizing: border-box;
  letter-spacing: 0.01em;
}
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-dark); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-dark); color: #fff; }

/* ── Highlight box (matches email amber left-border callout) ── */
.highlight-box {
  background: var(--amber-tint);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  padding: 14px 16px;
  margin: 1.25rem 0;
  text-align: left;
  font-size: 0.9rem;
  color: var(--amber-text);
  line-height: 1.6;
}
.highlight-box p { color: var(--amber-text); margin: 0; }

/* ── Inline code / command block ── */
.code-block {
  background: #e5e7eb;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font-size: 0.78rem;
  font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
  word-break: break-all;
  color: #374151;
  text-align: left;
  display: block;
}
.copy-btn {
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.copy-btn:hover { background: var(--navy-dark); }

/* ── Details / summary ── */
details {
  text-align: left;
  margin-top: 1.5rem;
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  user-select: none;
}
summary:hover { color: var(--text); }
.deep-link-block { margin-top: 0.75rem; }
.deep-link-block p { font-size: 0.85rem; color: var(--text); margin: 0 0 0.5rem; }

/* ── Site footer (Hyperspace-style dark footer) ── */
.site-footer {
  background: var(--navy);
  padding: 48px;
  text-align: center;
}
.site-footer img {
  height: clamp(48px, 6.7vw, 85px);
  width: clamp(48px, 6.7vw, 85px);
  display: block;
  margin: 0 auto 16px;
  border-radius: 24px;
}
.site-footer-copy {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  margin: 0 0 8px;
}
.site-footer-links {
  margin: 0;
  font-size: 0.8rem;
}
.site-footer-links a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
}
.site-footer-links a:hover { color: var(--gold); }

/* ── Page title bar (doc pages) ── */
.page-title-bar {
  background: var(--surface);
  padding: 32px 48px 24px;
  text-align: center;
  border-bottom: 5px solid var(--gold);
}
.page-title-bar h1 { font-size: 2rem; margin: 0; }
.page-title-bar p { color: var(--muted); margin: 8px 0 0; font-size: 0.875rem; }

/* ── Document page layout (terms / privacy) ── */

.doc-main {
  max-width: 860px;
  margin: 40px auto;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  padding: 40px 48px;
}
.doc-main section {
  padding: 28px 0;
  border-bottom: 1px solid var(--divider);
}
.doc-main section:last-child { border-bottom: none; }
.doc-main h2 { margin-top: 0; }
.doc-main ul { padding-left: 1.25rem; }
.doc-main li { margin-bottom: 6px; }

/* ── Table of contents (privacy page) ── */
.toc {
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  padding: 12px 24px;
  text-align: center;
  font-size: 0.85rem;
}
.toc a {
  color: var(--navy);
  text-decoration: none;
  margin: 0 10px;
}
.toc a:hover { color: var(--gold); text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .page-title-bar { padding: 24px 24px 20px; }
  .page-title-bar h1 { font-size: 1.5rem; }
  .site-footer { padding: 36px 24px; }
  .card { margin: 24px 16px; }
  .card-body { padding: 28px 24px 20px; }
  .card-logo { padding: 20px 24px 16px; }
  .card-footer-row { padding: 14px 24px 20px; }
  .doc-main { margin: 20px 16px; padding: 28px 24px; }
}
