/* ═══════════════════════════════════════════════════════
   INGREDIENT CHECKER — Shared Site Styles
   Brand: purple #3d0862 → magenta #a01068
   ═══════════════════════════════════════════════════════ */

/* ── CSS TOKENS ─────────────────────────────────────── */
:root {
  --bg:             #f8f7fa;
  --bg-card:        #ffffff;
  --bg-header:      #ffffff;
  --text:           #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted:     #9ca3af;
  --border:         #e5e0eb;

  /* Brand gradient */
  --brand-from:     #3d0862;
  --brand-to:       #a01068;
  --brand-gradient: linear-gradient(135deg, #3d0862 0%, #a01068 100%);
  --brand-gradient-hover: linear-gradient(135deg, #4e0a7c 0%, #b8177a 100%);

  /* Accent = brand magenta */
  --accent:         #9d1168;
  --accent-hover:   #7a0d52;
  --accent-light:   rgba(157,17,104,.08);
  --accent-text:    #9d1168;

  --shadow-sm:      0 1px 3px rgba(61,8,98,.08);
  --shadow:         0 1px 3px rgba(61,8,98,.08), 0 4px 16px rgba(61,8,98,.08);
  --radius:         12px;
}

/* ── Dark — OS preference ─────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:             #150d1e;
    --bg-card:        #201530;
    --bg-header:      #1a1025;
    --text:           #f0eaf5;
    --text-secondary: #b09ac0;
    --text-muted:     #6b5880;
    --border:         #2e1f45;
    --accent:         #d44fa0;
    --accent-hover:   #b83588;
    --accent-light:   rgba(212,79,160,.12);
    --accent-text:    #d44fa0;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.4);
    --shadow:         0 1px 3px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  }
}

/* ── Dark — explicit toggle ──────────────────────── */
:root[data-theme="dark"] {
  --bg:             #150d1e;
  --bg-card:        #201530;
  --bg-header:      #1a1025;
  --text:           #f0eaf5;
  --text-secondary: #b09ac0;
  --text-muted:     #6b5880;
  --border:         #2e1f45;
  --accent:         #d44fa0;
  --accent-hover:   #b83588;
  --accent-light:   rgba(212,79,160,.12);
  --accent-text:    #d44fa0;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.4);
  --shadow:         0 1px 3px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
}

/* ── Light — explicit toggle ─────────────────────── */
:root[data-theme="light"] {
  --bg:             #f8f7fa;
  --bg-card:        #ffffff;
  --bg-header:      #ffffff;
  --text:           #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted:     #9ca3af;
  --border:         #e5e0eb;
  --accent:         #9d1168;
  --accent-hover:   #7a0d52;
  --accent-light:   rgba(157,17,104,.08);
  --accent-text:    #9d1168;
  --shadow-sm:      0 1px 3px rgba(61,8,98,.08);
  --shadow:         0 1px 3px rgba(61,8,98,.08), 0 4px 16px rgba(61,8,98,.08);
}

/* ── RESET ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background .2s, color .2s;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }
a { color: inherit; text-decoration: none; }

/* ── HEADER ─────────────────────────────────────────── */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 32px;
  position: sticky;
  top: 0;
  z-index: 200;
  transition: background .2s, border-color .2s;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.site-logo img {
  border-radius: 8px;
  display: block;
}

.site-logo span {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── NAV ─────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.site-nav a {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}

.site-nav a:hover  { color: var(--text); background: var(--accent-light); }
.site-nav a.active { color: var(--accent-text); font-weight: 500; }

/* ── HEADER RIGHT ────────────────────────────────────── */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── INSTALL BUTTON ──────────────────────────────────── */
.install-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--brand-gradient);
  color: #fff !important;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 10px rgba(157,17,104,.35);
}

.install-btn:hover {
  background: var(--brand-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(157,17,104,.45);
}

.install-btn:active { transform: translateY(0); }

.install-btn svg { flex-shrink: 0; }

/* large variant */
.install-btn.lg {
  font-size: 16px;
  padding: 13px 28px;
  border-radius: 12px;
  gap: 10px;
}

/* inverted (white bg, brand-colored text) */
.install-btn.inverted {
  background: rgba(255,255,255,.95) !important;
  color: #9d1168 !important;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}

.install-btn.inverted:hover {
  background: #fff !important;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
}

/* ── THEME BUTTON ────────────────────────────────────── */
.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}

.theme-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* icon visibility */
.icon-sun  { display: none; }
.icon-moon { display: block; }

:root[data-theme="dark"] .icon-sun  { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun  { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ── BREADCRUMB ──────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 20px 40px 0;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.breadcrumb a { color: var(--text-secondary); transition: color .15s; }
.breadcrumb a:hover { color: var(--accent-text); }
.breadcrumb-sep { width: 12px; height: 12px; color: var(--text-muted); }

/* ── PAGE TITLE ──────────────────────────────────────── */
.page-title {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 8px;
}

/* ── CARD ────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background .2s, border-color .2s;
}

/* ── FOOTER ─────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-header);
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  transition: background .2s, border-color .2s;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color .15s;
}

.footer-links a:hover { color: var(--accent-text); }

/* ── LEGAL PAGES (privacy, terms) ───────────────────── */
.legal-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.legal-hero { margin-bottom: 32px; }

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px;
  transition: background .2s, border-color .2s;
}

.legal-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 12px;
}

.legal-card h2:first-child { margin-top: 0; }

.legal-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-card p,
.legal-card li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.legal-card p { margin-bottom: 14px; }

.legal-card ul {
  margin: 0 0 14px 0;
  padding-left: 22px;
}

.legal-card li { margin-bottom: 6px; }

.legal-card strong { color: var(--text); font-weight: 600; }

.legal-card a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: rgba(157,17,104,.3);
  text-underline-offset: 2px;
}

.legal-card a:hover { text-decoration-color: var(--accent); }

.legal-card hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* warning callout (used on terms.html medical disclaimer) */
.legal-callout {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  margin: 18px 0 20px;
  border-radius: 10px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #78350f;
}

:root[data-theme="dark"] .legal-callout {
  background: rgba(252, 211, 77, .08);
  border-color: rgba(252, 211, 77, .35);
  color: #fde68a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .legal-callout {
    background: rgba(252, 211, 77, .08);
    border-color: rgba(252, 211, 77, .35);
    color: #fde68a;
  }
}

.legal-callout svg { flex-shrink: 0; margin-top: 2px; }

.legal-callout p {
  color: inherit !important;
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.6;
}

.legal-callout strong { color: inherit; }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header  { padding: 0 16px; gap: 12px; }
  .site-nav a   { padding: 6px 8px; font-size: 13px; }
  .site-footer  { padding: 20px 16px; flex-direction: column; align-items: flex-start; }
  .breadcrumb   { padding: 16px 16px 0; }
}

@media (max-width: 560px) {
  .legal-card { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .site-nav { display: none; }
}
