:root {
  color-scheme: light;
  --violet: #6a2c91;
  --violet-clair: #a06cd5;
  --violet-pale: #f3ecfa;
  --vert: #1f9e78;
  --vert-pale: #e6f6ef;
  --rouge: #d64550;
  --rouge-pale: #fbe9ea;
  --or: #e9b949;
  --texte: #2a2233;
  --gris: #6b6475;
  --bord: #e6e0ee;
  --fond: #fbf9fd;
  --blanc: #ffffff;
  --radius: 14px;
  --ombre: 0 6px 24px rgba(106, 44, 145, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--texte);
  background: var(--fond);
  line-height: 1.55;
}
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Navbar ---- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: var(--blanc);
  border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 20;
}
.nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--violet); }
.nav .brand span.logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--violet), var(--violet-clair));
  color: #fff; display: grid; place-items: center; font-size: 1rem;
}
.nav .links { display: flex; gap: 18px; align-items: center; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 999px;
  border: none; cursor: pointer; font-weight: 600; font-size: 0.95rem;
  background: var(--violet); color: #fff; transition: transform .08s, box-shadow .2s;
}
.btn:hover { text-decoration: none; box-shadow: var(--ombre); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--violet); border: 1.5px solid var(--violet); }
.btn.vert { background: var(--vert); }
.btn.small { padding: 7px 14px; font-size: 0.85rem; }
.btn.danger { background: var(--rouge); }

/* ---- Layout ---- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 460px; margin: 48px auto; padding: 0 24px; }

/* ---- Hero ---- */
.hero {
  padding: 76px 24px 60px; text-align: center;
  background: radial-gradient(1200px 400px at 50% -10%, var(--violet-pale), transparent);
}
.hero h1 { font-size: 2.6rem; margin: 0 0 16px; line-height: 1.15; }
.hero h1 .accent { color: var(--violet); }
.hero p.lead { font-size: 1.15rem; color: var(--gris); max-width: 640px; margin: 0 auto 28px; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 56px 0; }
.pillar { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--radius); padding: 26px; }
.pillar .ico { font-size: 1.5rem; }
.pillar h3 { margin: 12px 0 8px; }
.pillar p { color: var(--gris); margin: 0; font-size: 0.95rem; }

/* ---- Cards / forms ---- */
.card { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--radius); padding: 26px; box-shadow: var(--ombre); }
.card h2 { margin-top: 0; }
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--bord);
  border-radius: 10px; font-size: 0.95rem; font-family: inherit; background: #fff;
}
input:focus, select:focus { outline: none; border-color: var(--violet-clair); }
.error { background: var(--rouge-pale); color: var(--rouge); padding: 10px 14px; border-radius: 10px; margin: 12px 0; font-size: 0.9rem; }
.muted { color: var(--gris); font-size: 0.9rem; }
.center { text-align: center; }

/* ---- Dashboard ---- */
.grid-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-top: 22px; }
.model-card { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.model-card h3 { margin: 0; }

/* ---- Calculator ---- */
.calc { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; padding: 24px 0 60px; }
@media (max-width: 900px){ .calc { grid-template-columns: 1fr; } }
.section { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.section > h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.section .hint { color: var(--gris); font-size: 0.85rem; margin: 0 0 14px; }
.row { display: grid; gap: 8px; align-items: end; margin-bottom: 8px; }
.row.charges { grid-template-columns: 2fr 1.1fr 1fr auto; }
.row.equipe  { grid-template-columns: 2fr 1fr 1.2fr auto; }
.row.invest  { grid-template-columns: 2fr 1fr 1.2fr auto; }
.row.offres  { grid-template-columns: 2fr 1fr 1fr 1fr auto; }
.row .col-label { font-size: 0.72rem; color: var(--gris); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.row input { padding: 8px 9px; font-size: 0.88rem; }
.mini-btn { background: var(--rouge-pale); color: var(--rouge); border: none; border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; }
.add-line { background: var(--vert-pale); color: var(--vert); border: 1px dashed var(--vert); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 0.85rem; margin-top: 6px; }

.params-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.check input { width: auto; }

/* ---- Results ---- */
.results { position: sticky; top: 88px; }
.verdict { border-radius: var(--radius); padding: 20px; text-align: center; margin-bottom: 16px; font-weight: 700; }
.verdict.ok { background: var(--vert-pale); color: var(--vert); border: 1.5px solid var(--vert); }
.verdict.ko { background: var(--rouge-pale); color: var(--rouge); border: 1.5px solid var(--rouge); }
.verdict .big { font-size: 1.6rem; display: block; margin-top: 4px; }
.kpi { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--bord); font-size: 0.92rem; }
.kpi:last-child { border-bottom: none; }
.kpi .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .val.neg { color: var(--rouge); }
.kpi .val.pos { color: var(--vert); }
.pl-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 0.9rem; }
.pl-table td { padding: 7px 4px; border-bottom: 1px solid var(--bord); font-variant-numeric: tabular-nums; }
.pl-table td:last-child { text-align: right; font-weight: 600; }
.pl-table tr.total td { font-weight: 800; border-top: 2px solid var(--texte); }

footer { text-align: center; padding: 30px; color: var(--gris); font-size: 0.85rem; border-top: 1px solid var(--bord); background: var(--blanc); }

/* ---- Print header (screen: hidden) ---- */
.print-header { display: none; }
@media print { .print-header { display: block; margin-bottom: 10mm; } }

/* ---- Google sign-in button ---- */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 20px; border-radius: 999px;
  border: 1.5px solid var(--bord); background: var(--blanc); color: var(--texte);
  font-size: 0.95rem; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: border-color .15s, box-shadow .2s; margin-bottom: 16px;
}
.btn-google:hover { border-color: #aaa; box-shadow: 0 2px 8px rgba(0,0,0,.08); text-decoration: none; }

/* ---- Divider "ou" ---- */
.divider-text {
  text-align: center; color: var(--gris); font-size: .82rem;
  position: relative; margin: 14px 0;
}
.divider-text::before, .divider-text::after {
  content: ''; position: absolute; top: 50%;
  width: 42%; height: 1px; background: var(--bord);
}
.divider-text::before { left: 0; }
.divider-text::after  { right: 0; }

/* ---- Upgrade banner ---- */
.upgrade-banner {
  background: linear-gradient(135deg, var(--violet-pale), #fff);
  border: 1.5px solid var(--violet-clair) !important;
}
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--vert); color: #fff; padding: 12px 22px; border-radius: 999px; box-shadow: var(--ombre); opacity: 0; transition: opacity .3s; z-index: 50; }
.toast.show { opacity: 1; }
