/* =========================================
   Le Bol Vert — Cuisine à domicile (clean)
   ========================================= */

/* ========== 1) Theme / tokens ========== */
:root{
  --bg:#f7fbf8;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --brand:#16a34a;
  --brand2:#22c55e;
  --brand3:#0ea5a4;
  --line: rgba(2,6,23,.10);
  --shadow: 0 10px 30px rgba(2,6,23,.10);
  --radius: 18px;
  --radius2: 14px;

  /* Spacing + container */
  --pad: clamp(14px, 1.2vw + 10px, 20px);
  --max: 1180px;

  /* Sticky header height (anchor offset) */
  --topbar-h: 86px;
}

/* ========== 2) Base reset ========== */
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(900px 420px at 20% -10%, rgba(34,197,94,.18), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(14,165,164,.12), transparent 55%),
    var(--bg);
  color:var(--text);
  line-height:1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a{ color:inherit; }
img{ max-width:100%; height:auto; display:block; }

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(14px, 2vw, 22px);
}

/* Anchor offset for sticky header */
section{
  scroll-margin-top: calc(var(--topbar-h) + 12px);
  margin-top: 14px;
}

/* ========== 3) Topbar / Navbar (same as index) ========== */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 0 16px;
  position:sticky;
  top:0;
  background: rgba(247,251,248,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(2,6,23,.06);
  z-index: 50;
  min-height: var(--topbar-h);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  min-width: 220px;
}


.brandTitle{
  display:flex;
  flex-direction:column;
  line-height:1.05;
}
.brandTitle b{ font-size:16px; letter-spacing:.2px; }
.brandTitle span{ font-size:12px; color:var(--muted); font-weight:700; }

/* Desktop nav */
.navToggle{ display:none; }
.navWrap{ display:flex; justify-content:flex-end; flex:1 1 auto; }

.navWrap nav{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.navWrap nav a{
  text-decoration:none;
  padding:9px 11px;
  border-radius:999px;
  color: var(--muted);
  font-weight:700;
  font-size:13px;
}

.navWrap nav a:hover{
  background: rgba(2,6,23,.06);
  color: var(--text);
}

/* ========== 4) UI primitives ========== */
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  font-size:12px;
  color:var(--muted);
  font-weight:800;
}

.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
}

.divider{
  height:1px;
  background: rgba(2,6,23,.08);
  margin: 12px 0;
}

.note{
  font-size:12px;
  color:var(--muted);
  margin-top:10px;
}

/* ========== 5) Typography ========== */
h1{
  margin:12px 0 10px;
  font-size: clamp(24px, 2.2vw + 14px, 38px);
  line-height:1.12;
  letter-spacing:-.3px;
}

h2{
  margin:0 0 10px;
  font-size: clamp(18px, 1.1vw + 14px, 22px);
}

p{ margin:0 0 12px; color:var(--muted); }

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:999px;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.22);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

/* ========== 6) Buttons ========== */
.ctaRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(2,6,23,.04);
  color: var(--text);
  cursor:pointer;
  text-decoration:none;
  font-weight:900;
  min-height:44px;
}

.btn:hover{ background: rgba(2,6,23,.06); }

.btn.primary{
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-color: transparent;
  color:white;
}
.btn.primary:hover{ filter: brightness(1.03); }

.btn.ghost{ background:#fff; }
.btn.ghost:hover{ background: rgba(2,6,23,.03); }

/* ========== 7) Layout blocks ========== */
.splitHero{
  display:grid;
  grid-template-columns: 1.35fr 0.65fr;
  grid-template-rows: auto auto;
  gap:14px;
  align-items:start;
}
.heroLeft{ grid-column:1; grid-row:1; }
.heroRight{ grid-column:2; grid-row:1; }
.heroBelow{ grid-column:1 / -1; grid-row:2; }

.heroIntro{
  font-size: clamp(14px, .35vw + 13px, 16px);
  line-height:1.45;
  margin:6px 0 10px;
  width:100%;
}

.imgWide{
  width:100%;
  border-radius: var(--radius2);
  border: 1px solid rgba(2,6,23,.06);
  object-fit: cover;
  aspect-ratio: 4 / 3;
}
.heroRight .imgWide{ height:100%; }

.kpis{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap:10px;
  margin-top:14px;
}
.kpi{
  border:1px solid var(--line);
  border-radius:14px;
  background: rgba(34,197,94,.06);
  padding:12px;
}
.kpi b{ display:block; font-size:13px; }
.kpi span{ display:block; font-size:12px; color:var(--muted); margin-top:4px; }
.kpi a{ text-decoration:none; font-weight:900; }
.kpi a:hover{ text-decoration: underline; }

.split{
  display:grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap:14px;
  align-items:start;
}

/* Services */
.serviceGrid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap:12px;
}

.serviceBox{
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  padding:14px;
}
.serviceBox h3{ margin:0 0 6px; font-size:15px; }

.serviceBox ul{
  list-style:none;
  padding:0;
  margin:10px 0 0;
  display:grid;
  gap:10px;
  font-size:15px;
}
.serviceBox li{
  position:relative;
  padding-left:28px;
  color:var(--muted);
  line-height:1.35;
}
.serviceBox li::before{
  content:"";
  position:absolute;
  left:0;
  top:.35em;
  width:14px;
  height:14px;
  border-radius:999px;
  background: rgba(34,197,94,.18);
  border: 1px solid rgba(34,197,94,.35);
  box-shadow: 0 2px 10px rgba(22,163,74,.12);
}
.serviceBox li::after{
  content:"✓";
  position:absolute;
  left:3px;
  top:.03em;
  font-size:12px;
  font-weight:1000;
  color: var(--brand);
}

/* Footer */
.footer{
  margin:16px 0 28px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  color:var(--muted);
  font-size:12px;
}
.legal a{
  color:var(--muted);
  text-decoration:none;
  font-weight:900;
}
.legal a:hover{ text-decoration: underline; }

/* ========== 8) Mobile navbar dropdown (same as index) ========== */
@media (max-width: 820px){
  .topbar{
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
  }

  .brand{
    flex: 1 1 auto;
    min-width: 0;
  }

  .navToggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    border-radius:14px;
    border: 1px solid var(--line);
    background:#fff;
    box-shadow: 0 8px 18px rgba(2,6,23,.08);
    cursor:pointer;
    padding:0;
  }

  .navWrap{
    position:absolute;
    left:0;
    right:0;
    top:100%;
    background: rgba(247,251,248,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(2,6,23,.08);

    max-height:0;
    overflow:hidden;
    transition: max-height .25s ease;
    z-index:60;
  }

  .navWrap nav{
    padding: 10px 18px 14px;
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:8px;
    justify-content: initial;
  }

  .navWrap nav a{
    display:flex;
    align-items:center;
    justify-content:center;
    padding: 11px 10px;
    border-radius:14px;
    background:#fff;
    border: 1px solid rgba(2,6,23,.08);
  }

  .topbar.nav-open .navWrap{
    max-height: 420px;
  }
  
   .navWrap nav{
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* stable 2 columns */
    justify-items: stretch;                           /* each cell full width */
  }

  .navWrap nav a{
    width: 100%;
    text-align: center;                               /* center label */
    justify-content: center;                          /* keep flex center */
  }

  /* If odd number of links -> last one centered on full row (like Home) */
  .navWrap nav a:last-child{
    grid-column: 1 / -1;
  }
  
  .navWrap nav{
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;   /* NOT center */
    justify-items: stretch;
  }

  /* Make each button fill its grid cell */
  .navWrap nav a{
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Last item full width (odd links) */
  .navWrap nav a:last-child{
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px){
  .navWrap nav{ grid-template-columns: 1fr; }
}

/* Burger -> X animation */
.burger{
  position:relative;
  width:20px;
  height:2px;
  background: rgba(2,6,23,.72);
  border-radius:999px;
  display:block;
}
.burger::before,
.burger::after{
  content:"";
  position:absolute;
  left:0;
  width:20px;
  height:2px;
  background: rgba(2,6,23,.72);
  border-radius:999px;
  transition: transform .2s ease, top .2s ease, opacity .2s ease;
}
.burger::before{ top:-6px; }
.burger::after{ top: 6px; }

.topbar.nav-open .burger{ background: transparent; }
.topbar.nav-open .burger::before{ top:0; transform: rotate(45deg); }
.topbar.nav-open .burger::after{ top:0; transform: rotate(-45deg); }

/* ========== 9) Responsive layout ========== */
@media (max-width: 980px){
  .splitHero{
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .heroLeft{ grid-column:1; grid-row:1; }
  .heroRight{ grid-column:1; grid-row:2; }
  .heroBelow{ grid-column:1; grid-row:3; }

  .split{ grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
}

/* =========================================
   Animations (light + premium)
   ========================================= */

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Keyframes */
@keyframes fadeUp{
  from{ opacity:0; transform: translateY(14px); }
  to{ opacity:1; transform: translateY(0); }
}
@keyframes fadeIn{
  from{ opacity:0; }
  to{ opacity:1; }
}
@keyframes pop{
  from{ transform: scale(.985); opacity:.5; }
  to{ transform: scale(1); opacity:1; }
}

/* Reveal system */
.reveal{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
  will-change: opacity, transform;
}
.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* Stagger support */
.reveal[data-delay="1"]{ transition-delay: .06s; }
.reveal[data-delay="2"]{ transition-delay: .12s; }
.reveal[data-delay="3"]{ transition-delay: .18s; }
.reveal[data-delay="4"]{ transition-delay: .24s; }
.reveal[data-delay="5"]{ transition-delay: .30s; }

/* Hero: animate on load (subtle) */
.card#domicile .badge{ animation: fadeIn .5s ease both; }
.card#domicile h1{ animation: fadeUp .6s ease both; }
.card#domicile .heroIntro{ animation: fadeUp .65s ease both; animation-delay: .05s; }
.card#domicile .kpis{ animation: fadeUp .7s ease both; animation-delay: .08s; }

/* KPI cards pop */
.kpi{ transition: transform .15s ease, box-shadow .15s ease; }
.kpi:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(2,6,23,.12);
}

/* Service cards hover */
.serviceBox{
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.serviceBox:hover{
  transform: translateY(-3px);
  border-color: rgba(22,163,74,.28);
  box-shadow: 0 18px 55px rgba(2,6,23,.14);
}

/* Buttons micro interaction */
.btn{
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.btn:active{ transform: translateY(1px); }

/* Navbar dropdown feel */
@media (max-width: 820px){
  .navWrap{
    transform-origin: top;
  }
  .topbar.nav-open .navWrap nav a{
    animation: pop .18s ease both;
  }
  /* tiny stagger on menu items */
  .topbar.nav-open .navWrap nav a:nth-child(1){ animation-delay: .02s; }
  .topbar.nav-open .navWrap nav a:nth-child(2){ animation-delay: .04s; }
  .topbar.nav-open .navWrap nav a:nth-child(3){ animation-delay: .06s; }
  .topbar.nav-open .navWrap nav a:nth-child(4){ animation-delay: .08s; }
  .topbar.nav-open .navWrap nav a:nth-child(5){ animation-delay: .10s; }
  .topbar.nav-open .navWrap nav a:nth-child(6){ animation-delay: .12s; }
}




/* ========== AUTH ACTIONS (Login / Profile / Dashboard) ========== */
.topbar{ position: relative; }

.authActions{
  display:flex;
  align-items:center;
  gap:10px;
  position: relative;
}

/* icon buttons */
.iconBtn{
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(2,6,23,.10);
  background: rgba(255,255,255,.85);
  display:grid;
  place-items:center;
  cursor:pointer;
  text-decoration:none;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  box-shadow: 0 10px 24px rgba(2,6,23,.08);
}
.iconBtn:hover{ transform: translateY(-1px); }
.iconBtn:active{ transform: translateY(0) scale(.98); }

/* dropdown */
.profileMenu{
  position:absolute;
  right:0;
  top: calc(100% + 8px);
  background:#fff;
  border:1px solid rgba(2,6,23,.10);
  border-radius:14px;
  box-shadow: 0 14px 34px rgba(2,6,23,.14);
  padding:8px;
  min-width: 180px;
  display:none;
  z-index: 80; /* above nav dropdown */
}
.profileMenu a{
  display:block;
  padding:10px 10px;
  border-radius:12px;
  text-decoration:none;
  color: inherit;
  font-weight: 900;
}
.profileMenu a:hover{ background: rgba(2,6,23,.04); }

.profileMenu.show{ display:block; }

/* default hidden states controlled by JS */
.authDash,
.authProfile{ display:none; }

/* Mobile: keep auth neat */
@media (max-width: 820px){
  .authActions{ gap:8px; }
  .authLogin{
    padding:10px 12px;
    border-radius:14px;
    font-weight:900;
  }
}
