/* =========================================================
   WariBook — feuille de style
   Couleurs principales : changez-les ici pour adapter la marque
   ========================================================= */
:root {
  --ink: #14211b;
  --ink-soft: #4a5a52;
  --muted: #7b8a82;
  --bg: #fbf7f0;
  --surface: #ffffff;
  --line: #e9e1d3;
  --forest: #0f3d2e;
  --forest-2: #175a43;
  --saffron: #e8a33d;
  --saffron-soft: #fbe9c8;
  --clay: #c8553d;
  --clay-soft: #f8ddd6;
  --mint-soft: #dcefe4;
  --sky-soft: #e1ebf7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 33, 27, .06), 0 8px 24px rgba(20, 33, 27, .06);
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--bg);
  font-size: 16px; line-height: 1.55;
}
a { color: var(--forest-2); }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.2em; border-radius: 10px; border: 1px solid transparent;
  font: 600 .95rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  background: var(--surface); color: var(--ink); border-color: var(--line);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--forest); color: #fff; border-color: var(--forest); }
.btn-primary:hover { background: var(--forest-2); }
.btn-accent { background: var(--saffron); color: var(--ink); border-color: var(--saffron); }
.btn-whatsapp { background: #25d366; color: #0b2e17; border-color: #25d366; }
.btn-danger { color: var(--clay); border-color: var(--clay-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-lg { padding: .9em 1.5em; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { padding: .45em .8em; font-size: .85rem; }
.btn-block { width: 100%; }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35em; }
input, select, textarea {
  width: 100%; padding: .7em .85em; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--saffron); outline-offset: 1px; border-color: var(--saffron); }
.field { margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .3em; }

/* ---------- Messages flash ---------- */
.flash { padding: .85em 1em; border-radius: 10px; margin-bottom: 1.25rem; font-weight: 500; }
.flash-success { background: var(--mint-soft); color: var(--forest); }
.flash-error { background: var(--clay-soft); color: #7a2a1a; }
.flash-info { background: var(--sky-soft); color: #1f3d66; }

/* ---------- Badges de statut ---------- */
.badge { display: inline-block; padding: .2em .65em; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-payee { background: var(--mint-soft); color: var(--forest); }
.badge-partielle { background: var(--sky-soft); color: #1f3d66; }
.badge-en_retard { background: var(--clay-soft); color: #8b2f1c; }
.badge-en_attente { background: var(--saffron-soft); color: #7a4d0b; }
.badge-annulee { background: #eee; color: #666; text-decoration: line-through; }

/* =========================================================
   LANDING PAGE
   ========================================================= */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(251, 247, 240, .9); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; }
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: .55em; font: 800 1.3rem var(--font-display); color: var(--forest); text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--forest); display: grid; place-items: center; }
.logo-mark svg { width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; gap: .5rem; align-items: center; }
.menu-toggle { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink); }

.hero { padding: 72px 0 40px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: .5em; background: var(--saffron-soft); color: #7a4d0b; padding: .35em .85em; border-radius: 999px; font-weight: 600; font-size: .85rem; margin-bottom: 1.2rem; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.7rem); font-weight: 800; color: var(--forest); }
.hero h1 em { font-style: normal; color: var(--clay); position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: .05em; height: .18em; background: var(--saffron); opacity: .55; z-index: -1; border-radius: 4px; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 34em; margin: 0 0 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 1.2rem; color: var(--ink-soft); font-size: .9rem; }
.hero-proof span::before { content: "✓ "; color: var(--forest-2); font-weight: 700; }

/* Motif géométrique inspiré du kente */
.pattern { position: absolute; inset: auto -40px -40px auto; width: 380px; height: 380px; opacity: .5; z-index: -1;
  background:
    repeating-linear-gradient(45deg, var(--saffron-soft) 0 14px, transparent 14px 28px),
    repeating-linear-gradient(-45deg, var(--mint-soft) 0 14px, transparent 14px 28px);
  border-radius: 40px; transform: rotate(8deg);
}

/* Mockup téléphone */
.mock { position: relative; }
.phone { width: 300px; margin: 0 auto; background: var(--ink); border-radius: 36px; padding: 12px; box-shadow: 0 30px 60px rgba(15, 61, 46, .25); }
.phone-screen { background: #ece5dd; border-radius: 26px; overflow: hidden; min-height: 520px; display: flex; flex-direction: column; }
.wa-top { background: #075e54; color: #fff; padding: 14px 16px; display: flex; gap: .7em; align-items: center; font-size: .9rem; }
.wa-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--saffron); display: grid; place-items: center; font-weight: 700; color: var(--ink); }
.wa-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bubble { background: #fff; border-radius: 10px; padding: 10px 12px; font-size: .82rem; max-width: 88%; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.bubble.out { background: #dcf8c6; align-self: flex-end; }
.bubble .inv-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-top: 8px; }
.inv-card .amt { font: 800 1.15rem var(--font-display); color: var(--forest); }
.bubble .time { display: block; text-align: right; font-size: .68rem; color: #888; margin-top: 4px; }
.float-card { position: absolute; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; font-size: .85rem; }
.float-card strong { font-family: var(--font-display); font-size: 1.1rem; display: block; }
.float-1 { left: -10px; top: 70px; }
.float-2 { right: -6px; bottom: 80px; }

.momo-strip { padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.momo-strip .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 2.2rem; color: var(--ink-soft); font-weight: 600; }
.momo-chip { display: inline-flex; align-items: center; gap: .5em; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.section { padding: 84px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); color: var(--forest); }
.section-head p { color: var(--ink-soft); font-size: 1.08rem; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--clay); margin-bottom: .6rem; display: block; }

.problem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.stat-card .big { font: 800 2.4rem var(--font-display); color: var(--clay); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: box-shadow .2s ease, transform .2s ease; }
.feature:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.feature-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 14px; }
.feature h3 { font-size: 1.2rem; }
.feature p { color: var(--ink-soft); margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.step { position: relative; padding-top: 58px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; font: 800 1.2rem var(--font-display); }
.step p { color: var(--ink-soft); }

.band { background: var(--forest); color: #fff; border-radius: 28px; padding: 56px; position: relative; overflow: hidden; }
.band h2 { color: #fff; }
.band p { color: rgba(255,255,255,.8); }
.band::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(232, 163, 61, .25); }

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 30px; display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--forest); position: relative; box-shadow: var(--shadow); }
.price-card.featured .tag { position: absolute; top: -13px; left: 30px; background: var(--saffron); color: var(--ink); padding: .2em .8em; border-radius: 999px; font-weight: 700; font-size: .8rem; }
.price { font: 800 2.4rem var(--font-display); color: var(--forest); margin: .3rem 0; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 1.2rem 0 1.6rem; flex: 1; }
.price-card li { padding: .4em 0; color: var(--ink-soft); }
.price-card li::before { content: "✓"; color: var(--forest-2); font-weight: 700; margin-right: .6em; }

.testimonials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.quote { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.quote p { font-size: 1.02rem; margin-top: 0; }
.quote .who { display: flex; align-items: center; gap: .7em; margin-top: 1rem; }
.quote .avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }

.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; margin-bottom: 12px; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--clay); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-soft); margin: .8rem 0 0; }

.site-footer { padding: 48px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }

/* =========================================================
   AUTHENTIFICATION
   ========================================================= */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--forest); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side .logo { color: #fff; }
.auth-side .logo-mark { background: var(--saffron); }
.auth-side h2 { font-size: 2.1rem; color: #fff; max-width: 14em; }
.auth-side p { color: rgba(255,255,255,.75); }
.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 2rem; color: var(--forest); }

/* =========================================================
   APPLICATION (espace connecté)
   ========================================================= */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--forest); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { color: #fff; padding: 0 8px 22px; }
.sidebar .logo-mark { background: var(--saffron); }
.side-nav a { display: flex; align-items: center; gap: .7em; color: rgba(255,255,255,.78); text-decoration: none; padding: .7em .8em; border-radius: 10px; font-weight: 500; margin-bottom: 2px; }
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-nav a.active { background: rgba(232,163,61,.18); color: #fff; }
.side-nav .ico { width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; }
.sidebar-foot .plan-pill { display: inline-block; background: var(--saffron); color: var(--ink); padding: .1em .6em; border-radius: 999px; font-weight: 700; font-size: .75rem; }
.sidebar-foot button { background: none; border: 0; color: rgba(255,255,255,.7); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }

.app-main { padding: 28px 36px 60px; min-width: 0; }
.app-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 24px; }
.app-topbar h1 { font-size: 1.8rem; margin: 0; color: var(--forest); }
.mobile-bar { display: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.card h2 { font-size: 1.15rem; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.kpi .label { color: var(--muted); font-size: .85rem; font-weight: 500; }
.kpi .value { font: 800 1.55rem var(--font-display); margin-top: .2em; }
.kpi.alert { background: var(--clay-soft); border-color: transparent; }
.kpi.alert .value { color: #8b2f1c; }
.kpi.good .value { color: var(--forest-2); }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }

.bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 46px; background: var(--forest-2); border-radius: 8px 8px 3px 3px; min-height: 3px; position: relative; }
.bar-col:last-child .bar { background: var(--saffron); }
.bar-col .lbl { font-size: .78rem; color: var(--muted); text-transform: capitalize; }
.bar-col .val { font-size: .72rem; color: var(--ink-soft); font-weight: 600; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8em .7em; text-align: left; border-bottom: 1px solid var(--line); font-size: .93rem; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #fcfaf5; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs a { padding: .45em .9em; border-radius: 999px; text-decoration: none; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); font-size: .88rem; font-weight: 500; }
.tabs a.active { background: var(--forest); color: #fff; border-color: var(--forest); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .emoji { font-size: 2.4rem; }

.setup-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; background: var(--saffron-soft); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; }

.items-table input { padding: .55em .65em; }
.items-table td { padding: .4em .35em; vertical-align: middle; }
.total-line { display: flex; justify-content: flex-end; gap: 1.5rem; font: 800 1.4rem var(--font-display); color: var(--forest); margin-top: 12px; }

.actions-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.share-box { display: flex; gap: .5rem; }
.share-box input { font-size: .85rem; background: #faf8f3; }

dialog { border: 0; border-radius: 16px; padding: 24px; width: min(480px, 92vw); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20, 33, 27, .45); }

/* =========================================================
   FACTURE (affichage + impression)
   ========================================================= */
.invoice-page { max-width: 820px; margin: 0 auto; padding: 32px 20px 60px; }
.invoice-doc { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 40px; position: relative; overflow: hidden; }
.invoice-doc::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: repeating-linear-gradient(90deg, var(--forest) 0 40px, var(--saffron) 40px 60px, var(--clay) 60px 72px); }
.inv-head { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-bottom: 30px; }
.inv-head h2 { font-size: 1.6rem; color: var(--forest); margin-bottom: .2em; }
.inv-meta { text-align: right; }
.inv-meta .num { font: 800 1.4rem var(--font-display); }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
.inv-parties .box { background: #faf8f3; border-radius: 12px; padding: 14px 16px; }
.inv-parties .lab { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.inv-totals { margin-left: auto; max-width: 320px; margin-top: 16px; }
.inv-totals div { display: flex; justify-content: space-between; padding: .4em 0; }
.inv-totals .grand { border-top: 2px solid var(--forest); margin-top: .3em; padding-top: .7em; font: 800 1.3rem var(--font-display); color: var(--forest); }
.pay-box { margin-top: 30px; border: 2px dashed var(--saffron); border-radius: 14px; padding: 20px; background: #fffaf0; }
.pay-box h3 { font-size: 1.1rem; }
.momo-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.momo-item { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.momo-item .op { font-size: .8rem; font-weight: 700; display: flex; align-items: center; gap: .4em; }
.momo-item .no { font: 700 1.05rem var(--font-display); letter-spacing: .02em; }
.paid-stamp { position: absolute; left: 48px; bottom: 110px; transform: rotate(-12deg); border: 4px solid var(--forest-2); color: var(--forest-2); font: 800 2rem var(--font-display); padding: .1em .5em; border-radius: 10px; opacity: .8; }
.powered { text-align: center; margin-top: 18px; font-size: .85rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .two-col, .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .features, .pricing, .testimonials, .problem-grid, .steps { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--bg); padding: 20px; border-bottom: 1px solid var(--line); gap: 1rem; }
  .menu-toggle { display: block; }
  .nav-cta .btn-ghost { display: none; }
  .band { padding: 36px 24px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--forest); color: #fff; position: sticky; top: 0; z-index: 40; }
  .mobile-bar .logo { color: #fff; font-size: 1.1rem; }
  .mobile-bar .logo-mark { background: var(--saffron); }
  .mobile-bar button { background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }
  .app-main { padding: 20px 16px 60px; }
  .invoice-doc { padding: 28px 18px; }
  .inv-parties, .grid-2 { grid-template-columns: 1fr; }
  .inv-meta { text-align: left; }
  .float-card { display: none; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr; }
  .phone { width: 100%; max-width: 300px; }
}

@media print {
  body { background: #fff; }
  .no-print, .sidebar, .mobile-bar, .app-topbar, .flash { display: none !important; }
  .app-shell { display: block; }
  .app-main, .invoice-page { padding: 0; }
  .invoice-doc { border: 0; padding: 0; }
}
