/* Tabba — journal alimentaire. Palette = design system de l'app.
   Deux thèmes via [data-theme] : light = crème Tabba, dark = palette sombre Doongu. */
:root, [data-theme="light"] {
  --primary: #58D68D;
  --primary-d: #45B575;
  --accent: #E67E22;
  --background: #F7F3E9;
  --surface: #FFFFFF;
  --text: #3D3D3D;
  --text-muted: #8A8378;
  --track: #E8DCC4;
  --border: #E4DCC9;
  --header-bg: rgba(247, 243, 233, 0.8);
  --cta-bg: linear-gradient(160deg, #ffffff, #FBF7EE);
  --radius: 20px;
  --maxw: 1080px;
}
[data-theme="dark"] {
  --primary: #58D68D;
  --primary-d: #5fe39b;
  --accent: #E67E22;
  --background: #0E1117;
  --surface: #1B212C;
  --text: #ECECEC;
  --text-muted: #9AA3B2;
  --track: #283041;
  --border: #283041;
  --header-bg: rgba(14, 17, 23, 0.75);
  --cta-bg: linear-gradient(160deg, #1B212C, #161B24);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}
a { color: inherit; text-decoration: none; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 22px; letter-spacing: -0.5px; }
.brand img { width: 38px; height: 38px; }
.nav-links { display: flex; gap: 28px; font-size: 15px; color: var(--text-muted); }
.nav-links a:hover { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 600;
  padding: 12px 22px; border-radius: 999px; font-size: 15px;
  transition: transform .15s ease, filter .15s ease;
  box-shadow: 0 6px 18px rgba(230,126,34,.25);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn.green { background: var(--primary); color: #14361f; box-shadow: 0 6px 18px rgba(88,214,141,.3); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.lang-select {
  appearance: none; -webkit-appearance: none;
  background-color: var(--surface); color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' fill='none' stroke='%238A8378' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 11px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 36px 9px 16px; font: inherit; font-size: 14px; cursor: pointer;
  transition: border-color .15s ease, background-color .2s ease;
}
.lang-select:hover { border-color: var(--primary-d); }
.lang-select:focus-visible { outline: none; border-color: var(--primary); }
.lang-select option { background: var(--surface); color: var(--text); }
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px; padding: 0;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); font-size: 16px; line-height: 1; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--primary-d); }

/* Hero */
.hero { padding: 80px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .5px;
  color: var(--primary-d); background: rgba(88,214,141,.14);
  border-radius: 999px; padding: 7px 16px; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(36px, 5.5vw, 58px); font-weight: 800; line-height: 1.07;
  letter-spacing: -1.2px; margin-bottom: 20px;
}
.hero h1 .em { color: var(--accent); }
.hero p.lead { font-size: 19px; color: var(--text-muted); max-width: 520px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual { display: grid; place-items: center; position: relative; }
.hero-visual .blob {
  position: absolute; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(88,214,141,.25), transparent 70%);
}
.hero-visual img { width: 260px; position: relative; filter: drop-shadow(0 24px 40px rgba(61,61,61,.18)); }

/* Sections */
section { padding: 64px 0; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-title { font-size: clamp(28px, 4vw, 38px); font-weight: 700; letter-spacing: -0.8px; margin-bottom: 12px; }
.section-sub { color: var(--text-muted); max-width: 540px; margin: 0 auto; font-size: 17px; }

/* Features */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(61,61,61,.08); }
.card .ic {
  width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  background: var(--background); font-size: 24px; margin-bottom: 16px;
}
.card h3 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.card p { color: var(--text-muted); font-size: 15px; }

/* Privacy band */
.band {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 48px;
  display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center;
}
.band .mascot { width: 120px; }
.band h3 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 10px; }
.band p { color: var(--text-muted); margin-bottom: 18px; }

/* CTA */
.cta {
  text-align: center;
  background: var(--cta-bg);
  border: 1px solid var(--border); border-radius: 24px; padding: 56px 32px;
}
.cta h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 700; letter-spacing: -0.6px; margin-bottom: 12px; }
.cta p { color: var(--text-muted); margin-bottom: 28px; font-size: 17px; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--text-muted); font-size: 14px; }
.foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.foot a:hover { color: var(--text); }

/* Legal / privacy page */
.legal { padding: 56px 0 80px; }
.legal .doc { max-width: 760px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: 20px; padding: 48px; }
.legal h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.8px; margin-bottom: 8px; }
.legal .updated { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }
.legal h2 { font-size: 21px; font-weight: 700; margin: 32px 0 10px; letter-spacing: -0.3px; }
.legal p, .legal li { color: var(--text); font-size: 16px; margin-bottom: 10px; }
.legal ul { padding-left: 22px; margin-bottom: 10px; }
.legal a { color: var(--primary-d); font-weight: 600; }
.legal .back { display: inline-block; margin-bottom: 24px; color: var(--text-muted); font-weight: 500; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { order: -1; }
  .nav-links { display: none; }
  .band { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .legal .doc { padding: 28px; }
}

/* API pricing page */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border-radius: 12px; border: 1px solid var(--border); }
.pricing-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
.pricing-table th { background: var(--background); font-weight: 600; text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--border); white-space: nowrap; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.pricing-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); }
.pricing-table tr:last-child td { border-bottom: none; }
.pricing-table tbody tr:hover td { background: var(--background); }
.ptag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; letter-spacing: .3px; white-space: nowrap; }
.ptag.eco { background: rgba(88,214,141,.15); color: var(--primary-d); }
.ptag.bal { background: rgba(230,126,34,.12); color: var(--accent); }
.ptag.max { background: rgba(124,58,237,.13); color: #7c3aed; }
.ptag.free { background: rgba(88,214,141,.28); color: var(--primary-d); }
[data-theme="dark"] .ptag.max { color: #a78bfa; background: rgba(167,139,250,.15); }
.provider-tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 11px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.provider-eu { background: rgba(88,214,141,.14); color: var(--primary-d); }
.provider-note { background: rgba(230,126,34,.12); color: var(--accent); }
.note-block { background: rgba(88,214,141,.10); border: 1px solid rgba(88,214,141,.3); border-radius: 12px; padding: 12px 18px; margin: 12px 0 20px; font-size: 15px; }
.rec-list { padding-left: 22px; margin: 12px 0 16px; }
.rec-list li { margin-bottom: 8px; color: var(--text); font-size: 15px; }
