/* =========================================================
   NOVIX — Design System
   Thème : Émeraude / Dark — SaaS d'affiliation premium
   ========================================================= */

:root {
  /* Surfaces — thème clair lumineux */
  --bg: #f4faf7;
  --bg-2: #ecf5f0;
  --surface: #ffffff;
  --surface-2: #f3f9f6;
  --surface-3: #e4f2eb;
  --border: rgba(5, 150, 105, 0.14);
  --border-strong: rgba(5, 150, 105, 0.30);

  /* Émeraude */
  --emerald-300: #6ee7b7;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --mint: #047857;

  /* Texte */
  --ink: #072019;
  --ink-2: #3c5750;
  --ink-3: #6b8579;

  /* Accents fonctionnels */
  --good: #059669;
  --warn: #d97706;
  --danger: #e11d48;
  --info: #0284c7;

  /* Surfaces sémantiques (thème) */
  --nav-bg: rgba(255, 255, 255, 0.82);
  --grid: rgba(5, 150, 105, 0.14);

  /* Effets */
  --glow: 0 0 0 1px rgba(16,185,129,.12), 0 24px 60px -24px rgba(16,185,129,.30);
  --radius: 18px;
  --radius-sm: 12px;
  --grad: linear-gradient(135deg, #34d399 0%, #059669 100%);
  --grad-soft: linear-gradient(135deg, rgba(52,211,153,.14), rgba(5,150,105,.05));
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ===================== Thème NUIT ===================== */
html[data-theme="dark"] {
  --bg: #070b09;
  --bg-2: #0b1310;
  --surface: #0e1814;
  --surface-2: #12211b;
  --surface-3: #172c23;
  --border: rgba(52, 211, 153, 0.12);
  --border-strong: rgba(52, 211, 153, 0.28);
  --mint: #6ee7b7;
  --ink: #eafff6;
  --ink-2: #b6ccc2;
  --ink-3: #7d968c;
  --good: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --info: #38bdf8;
  --nav-bg: rgba(7, 11, 9, 0.72);
  --grid: rgba(52, 211, 153, 0.10);
  --glow: 0 0 0 1px rgba(52,211,153,.15), 0 20px 60px -20px rgba(16,185,129,.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; max-width: 100%; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .35s ease, color .35s ease;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
ul { list-style: none; }

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(700px 500px at 82% -8%, rgba(52,211,153,.16), transparent 60%),
    radial-gradient(600px 500px at 2% 12%, rgba(16,185,129,.12), transparent 55%),
    radial-gradient(900px 700px at 50% 118%, rgba(110,231,183,.14), transparent 62%);
  pointer-events: none;
  z-index: 0;
}

.container { width: min(1200px, 92vw); margin: 0 auto; position: relative; z-index: 1; }

/* ===================== Header / Nav flottant (pilule) ===================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: transparent;
  border-bottom: none;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
}
.nav .nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
  padding: 0 12px 0 22px;
  border-radius: 999px;
  background: var(--nav-bg);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 44px -18px rgba(2, 22, 14, .45), 0 2px 8px -4px rgba(2, 22, 14, .3);
  transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand .logo-mark { width: 36px; height: 36px; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--ink-2); font-weight: 500; font-size: 15px; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 15px;
  cursor: pointer; border: 1px solid transparent; transition: all .22s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--grad); color: #04120c; box-shadow: 0 10px 30px -10px rgba(16,185,129,.7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(16,185,129,.85); }
.btn-ghost { background: var(--surface); color: var(--mint); border-color: var(--border-strong); }
.btn-ghost:hover { background: rgba(52,211,153,.10); border-color: var(--emerald-500); }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-block { width: 100%; }

.burger { display: none; background: none; border: none; color: var(--ink); cursor: pointer; }

/* Theme toggle */
.theme-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: 12px; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-strong);
  transition: background .2s, border-color .2s, transform .2s;
}
.theme-btn:hover { border-color: var(--emerald-500); transform: translateY(-1px); }
.theme-btn .i-sun { display: none; }
.theme-btn .i-moon { display: block; }
html[data-theme="dark"] .theme-btn .i-sun { display: block; }
html[data-theme="dark"] .theme-btn .i-moon { display: none; }

/* ===================== Hero ===================== */
.hero { padding: 90px 0 70px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  background: var(--grad-soft); border: 1px solid var(--border-strong);
  color: var(--mint); font-size: 13px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: 28px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald-400); box-shadow: 0 0 12px var(--emerald-400); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

h1 { font-size: clamp(38px, 6vw, 68px); line-height: 1.04; letter-spacing: -.03em; font-weight: 800; }
.hero h1 { max-width: 900px; margin: 0 auto; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(17px, 2vw, 20px); color: var(--ink-2); max-width: 620px; margin: 24px auto 36px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.trust-row { display: flex; gap: 34px; justify-content: center; flex-wrap: wrap; margin-top: 54px; color: var(--ink-3); font-size: 14px; }
.trust-row b { color: var(--ink); font-size: 26px; display: block; font-weight: 800; }
.trust-row .grad-text { font-size: 26px; }

/* ===================== Sections ===================== */
section { position: relative; z-index: 1; padding: 80px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 54px; }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -.02em; font-weight: 800; }
.section-head p { color: var(--ink-2); font-size: 18px; margin-top: 16px; }

/* Cards grid */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: 0 24px 60px -30px rgba(16,185,129,.5); }
.card .ic {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; margin-bottom: 18px;
  background: var(--grad-soft); border: 1px solid var(--border-strong); color: var(--emerald-400);
}
.card h3 { font-size: 20px; margin-bottom: 10px; letter-spacing: -.01em; }
.card p { color: var(--ink-2); font-size: 15px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 22px; counter-reset: step; }
.step { position: relative; padding: 30px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.step .num {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: #04120c; background: var(--grad); margin-bottom: 18px;
}
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { color: var(--ink-2); font-size: 14.5px; }

/* Feature split */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 54px; align-items: center; }
.split h2 { font-size: clamp(28px,3.5vw,40px); letter-spacing: -.02em; margin-bottom: 20px; }
.split p { color: var(--ink-2); font-size: 17px; margin-bottom: 16px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; color: var(--ink); }
.check-list .tick { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--grad-soft); border: 1px solid var(--border-strong); color: var(--emerald-400); display: grid; place-items: center; font-size: 13px; margin-top: 2px; }

/* Dashboard preview mock */
.mock {
  background: linear-gradient(180deg, var(--surface-2), var(--bg-2));
  border: 1px solid var(--border-strong);
  border-radius: 22px; padding: 22px;
  box-shadow: var(--glow);
}
.mock-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.mock-dots { display: flex; gap: 7px; }
.mock-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--surface-3); display: block; }
.mock-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }
.mini-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.mini-stat span { font-size: 12px; color: var(--ink-3); }
.mini-stat b { display: block; font-size: 22px; margin-top: 4px; letter-spacing: -.02em; }
.mini-stat .up { color: var(--good); font-size: 12px; font-weight: 600; }

/* Offers table (mock + real) */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 15px 18px; font-size: 14.5px; }
thead th { color: var(--ink-3); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); background: var(--bg-2); }
tbody tr { border-bottom: 1px solid var(--border); transition: background .2s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(52,211,153,.04); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.green { background: rgba(52,211,153,.14); color: var(--emerald-300); }
.badge.amber { background: rgba(251,191,36,.14); color: var(--warn); }
.badge.blue { background: rgba(56,189,248,.14); color: var(--info); }
.tag-cat { color: var(--ink-3); font-size: 12.5px; }

/* Payments / referral */
.pill-row { display: flex; gap: 12px; flex-wrap: wrap; }
.pay-pill { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; }

/* CTA band */
.cta-band {
  background: var(--grad);
  border-radius: 28px; padding: 60px; text-align: center; color: #04120c;
  position: relative; overflow: hidden;
}
.cta-band h2 { font-size: clamp(28px,4vw,42px); color: #04120c; letter-spacing: -.02em; }
.cta-band p { color: rgba(4,18,12,.75); font-size: 18px; margin: 14px auto 28px; max-width: 520px; }
.cta-band .btn-ghost { background: #04120c; color: var(--mint); border-color: transparent; }
.cta-band .btn-ghost:hover { background: #06180f; }

/* Testimonials */
.quote { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.quote p { color: var(--ink); font-size: 15.5px; margin-bottom: 18px; }
.quote .who { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 800; color: #04120c; }
.quote .who b { font-size: 14px; }
.quote .who span { font-size: 12.5px; color: var(--ink-3); display: block; }
.stars { color: var(--warn); font-size: 14px; margin-bottom: 12px; }

/* FAQ */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--surface); overflow: hidden; }
.faq-q { width: 100%; text-align: left; background: none; border: none; color: var(--ink); font-size: 16px; font-weight: 600; padding: 20px 22px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-family: inherit; }
.faq-q .plus { color: var(--emerald-400); transition: transform .25s; font-size: 22px; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; color: var(--ink-2); padding: 0 22px; }
.faq-item.open .faq-a { max-height: 300px; padding-bottom: 20px; }

/* ===================== Footer ===================== */
footer { border-top: 1px solid var(--border); padding: 60px 0 calc(30px + env(safe-area-inset-bottom, 0px)); margin-top: 40px; position: relative; z-index: 1; background: var(--surface-2); }
.foot-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: var(--grad-soft); border: 1px solid var(--border-strong); color: var(--mint); font-size: 12.5px; font-weight: 600; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.foot-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 16px; }
.foot-grid a { display: block; color: var(--ink-2); font-size: 14.5px; margin-bottom: 11px; transition: color .2s; }
.foot-grid a:hover { color: var(--emerald-300); }
.foot-grid p { color: var(--ink-3); font-size: 14px; margin-top: 14px; max-width: 280px; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 26px; border-top: 1px solid var(--border); color: var(--ink-3); font-size: 13.5px; flex-wrap: wrap; gap: 12px; }

/* ===================== Auth (login) ===================== */
.auth-wrap { min-height: calc(100vh - 72px); display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { padding: 70px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(160deg, var(--surface-2), var(--bg)); border-right: 1px solid var(--border); }
.auth-side h2 { font-size: 34px; letter-spacing: -.02em; margin: 26px 0 16px; }
.auth-side p { color: var(--ink-2); font-size: 16px; max-width: 380px; }
.auth-feats { margin-top: 34px; }
.auth-main { display: grid; place-items: center; padding: 40px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: 30px; margin-bottom: 8px; }
.auth-card > p { color: var(--ink-2); margin-bottom: 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; color: var(--ink-2); margin-bottom: 8px; font-weight: 500; }
.field input {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink);
  font-size: 15px; font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--emerald-400); box-shadow: 0 0 0 3px rgba(52,211,153,.16); }
.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; font-size: 14px; color: var(--ink-2); }
.demo-box { margin-top: 24px; padding: 16px 18px; border-radius: 12px; background: var(--grad-soft); border: 1px dashed var(--border-strong); font-size: 14px; color: var(--ink-2); }
.demo-box b { color: var(--mint); }
.demo-box code { background: rgba(5,150,105,.12); padding: 2px 8px; border-radius: 6px; color: var(--mint); font-weight: 600; font-size: 13.5px; }
.auth-error { display: none; background: rgba(225,29,72,.08); border: 1px solid rgba(225,29,72,.35); color: #be123c; padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 18px; }
.auth-error.show { display: block; }

/* ===================== Page hero (interior) ===================== */
.page-hero { padding: 70px 0 40px; text-align: center; }
.page-hero h1 { font-size: clamp(34px,5vw,54px); }
.page-hero p { color: var(--ink-2); font-size: 18px; max-width: 600px; margin: 18px auto 0; }

/* ===================== Reveal animation ===================== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===================== Responsive ===================== */
.mobile-only { display: none; }

@media (max-width: 960px) {
  .nav-links, .nav-cta .btn-ghost, .nav-cta .btn-primary { display: none; }
  .burger { display: inline-flex; align-items: center; }
  .nav-links.open {
    display: flex; position: absolute; top: calc(100% + 10px); left: 3vw; right: 3vw;
    flex-direction: column; background: var(--nav-bg); backdrop-filter: blur(20px);
    padding: 16px 20px; gap: 4px; border-radius: 20px;
    border: 1px solid var(--border-strong); box-shadow: 0 24px 50px -20px rgba(0,0,0,.5);
  }
  .nav-links.open a { padding: 12px 6px; font-size: 16px; border-radius: 10px; text-align: center; }
  .nav-links.open .mobile-only { display: block; }
  .nav-links.open .mobile-only:first-of-type { margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--border); }
  .grid-3, .grid-4, .steps { grid-template-columns: repeat(2,1fr); }
  .split, .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-wrap { min-height: auto; }
  .auth-main { padding: 40px 6vw 60px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  section { padding: 60px 0; }
  .hero { padding: 60px 0 50px; }
}

@media (max-width: 620px) {
  .container { width: 92vw; }
  .grid-2, .grid-3, .grid-4, .steps, .mock-stats { grid-template-columns: 1fr; }
  .cta-band { padding: 38px 22px; border-radius: 22px; }
  .foot-grid { grid-template-columns: 1fr; gap: 26px; }
  .foot-bottom { flex-direction: column; text-align: center; gap: 8px; }
  th, td { padding: 12px 14px; }
  .hide-sm { display: none !important; }
  .trust-row { gap: 22px 30px; }
  .hero p.lead { font-size: 16px; }
  .btn-lg { padding: 14px 22px; font-size: 15px; }
  .hero-actions .btn, .cta-band .btn { width: 100%; }
  .mock { padding: 16px; border-radius: 18px; }
  .mock table { table-layout: fixed; width: 100%; }
  .mock th, .mock td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pay-pill { font-size: 14px; padding: 10px 14px; }
}

@media (max-width: 380px) {
  h1 { font-size: 34px; }
  .brand { font-size: 18px; }
}
