/* ============================================================
   Calculeo — Design System (original design, 2026)
   Palette : encre bleu nuit #15315B · accents orange brûlé #B3490F
   ============================================================ */

:root {
  --ink: #15315B;
  --ink-deep: #0e2244;
  --ink-soft: #3d5578;
  --accent: #B3490F;
  --accent-soft: #fdf1ea;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-alt: #eef1f5;
  --line: #dde3ec;
  --text: #1c2536;
  --text-muted: #5b6b82;
  --ok: #1d7a4f;
  --ok-bg: #e8f5ee;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(14, 34, 68, .05), 0 6px 24px rgba(14, 34, 68, .07);
  --maxw: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Avenir Next", "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16.5px;
}

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); font-weight: 700; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(14, 34, 68, .25);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.logo {
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  letter-spacing: -0.3px;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.logo .dot { color: var(--accent); }
.logo:hover { text-decoration: none; }
.main-nav { display: flex; gap: 4px; }
.main-nav a {
  color: #c9d5e8;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
}
.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, .12); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; padding: 6px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 16px 0 0;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { margin: 0 6px; opacity: .5; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--ink-deep) 0%, var(--ink) 62%, #1c3f6e 100%);
  color: #fff;
  padding: 56px 0 64px;
}
.hero h1 {
  color: #fff;
  font-size: clamp(30px, 5vw, 44px);
  max-width: 780px;
  letter-spacing: -0.5px;
}
.hero h1 em {
  font-style: normal;
  color: #f5a877;
}
.hero .lede {
  max-width: 720px;
  margin-top: 14px;
  font-size: 18px;
  color: #cdd9ec;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.hero-badges span {
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #e4ecf7;
}

/* ---------- Sections ---------- */
section { padding: 44px 0; }
.section-head { margin-bottom: 26px; }
.section-head .kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent);
  margin-bottom: 8px;
}
.section-head h2 { font-size: clamp(24px, 3.4vw, 32px); }
.section-head p { color: var(--text-muted); margin-top: 8px; max-width: 720px; }

/* ---------- Tool cards grid ---------- */
.cat-block { margin-bottom: 42px; }
.cat-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  margin-bottom: 6px;
}
.cat-title .emoji { font-size: 26px; }
.cat-title a { color: var(--ink); }
.cat-sub { color: var(--text-muted); font-size: 15px; margin-bottom: 18px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  display: block;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #b9c6d8;
}
.card .ico { font-size: 24px; margin-bottom: 8px; }
.card .t { font-weight: 700; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.card .d { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

/* ---------- KPI strip ---------- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: block;
  color: inherit;
}
.kpi:hover { text-decoration: none; border-color: #b9c6d8; box-shadow: var(--shadow); }
.kpi .k-label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); }
.kpi .k-val { font-size: 19px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.kpi .k-note { font-size: 13px; color: var(--accent); margin-top: 2px; font-weight: 600; }

/* ---------- Calculator ---------- */
.calc-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 26px 0;
}
.calc-head {
  background: var(--ink);
  color: #fff;
  padding: 14px 22px;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.calc-body { padding: 24px 22px; }
.field { margin-bottom: 18px; }
.field > label {
  display: block;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 7px;
}
.field .hint { font-size: 13px; color: var(--text-muted); margin-top: 5px; }
input[type="number"], input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(21, 49, 91, .12);
}
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.seg label {
  flex: 1 1 auto;
  text-align: center;
  padding: 10px 12px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: #fff;
  cursor: pointer;
  border-right: 1px solid var(--line);
  user-select: none;
}
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + label,
.seg label.on {
  background: var(--ink);
  color: #fff;
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 13px 26px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:hover { background: #933d0c; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-wide { width: 100%; }

/* ---------- Result panel ---------- */
.result {
  margin-top: 22px;
  background: var(--ok-bg);
  border: 1.5px solid #bfe3cf;
  border-radius: var(--radius);
  padding: 20px 22px;
  display: none;
}
.result.show { display: block; }
.result .r-big { font-size: 34px; font-weight: 800; color: var(--ok); letter-spacing: -0.5px; }
.result .r-caption { font-size: 14px; font-weight: 700; color: var(--ok); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px; }
.result table { width: 100%; margin-top: 14px; border-collapse: collapse; }
.result table td { padding: 8px 4px; font-size: 15px; border-top: 1px solid #cfe6d9; }
.result table td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.result .r-note { font-size: 13px; color: var(--text-muted); margin-top: 12px; }

/* ---------- Quick examples ---------- */
.quick-ex {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.quick-ex button {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.quick-ex button:hover { border-color: var(--accent); background: var(--accent-soft); }
.quick-ex .qe-val { font-weight: 800; color: var(--ink); font-size: 15.5px; }
.quick-ex .qe-lab { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

/* ---------- Info callouts ---------- */
.callout {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 15px;
  border-left: 4px solid var(--ink);
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.callout.warn { border-left-color: var(--accent); background: var(--accent-soft); }
.callout.ok { border-left-color: var(--ok); background: var(--ok-bg); }

/* ---------- Article content ---------- */
.article { max-width: 820px; }
.article h2 { font-size: clamp(23px, 3vw, 29px); margin: 40px 0 14px; }
.article h3 { font-size: 19.5px; margin: 28px 0 10px; }
.article p { margin: 12px 0; color: var(--text); }
.article ul, .article ol { margin: 12px 0 12px 24px; }
.article li { margin: 7px 0; }
.article strong { color: var(--ink); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14.5px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(14,34,68,.08);
}
.data-table th {
  background: var(--ink);
  color: #fff;
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
}
.data-table td { padding: 10px 14px; border-top: 1px solid var(--line); }
.data-table tr:nth-child(even) td { background: #f8fafc; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-item summary {
  padding: 15px 18px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 40px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--accent);
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-body { padding: 0 18px 16px; color: var(--text); font-size: 15.5px; }

/* ---------- Related links ---------- */
.related {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.related a {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.related a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Two column feature ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.feature h3 { font-size: 17.5px; margin-bottom: 8px; }
.feature p { font-size: 14.5px; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink-deep);
  color: #b9c7dc;
  margin-top: 50px;
  padding: 44px 0 30px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
}
.footer-grid h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin: 7px 0; }
.footer-grid a { color: #b9c7dc; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .14);
  margin-top: 30px;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: #8fa3c0;
  font-size: 13px;
}

/* ---------- Update badge ---------- */
.updated {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.updated .dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--ink);
    flex-direction: column;
    padding: 12px 20px 18px;
    gap: 2px;
    box-shadow: 0 12px 24px rgba(14,34,68,.3);
  }
  .main-nav.open { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 40px 0 46px; }
  .calc-body { padding: 18px 16px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
