/* ============================================================
   WAREHOUSE-FR — Appel d'offres logistique
   Design system
   ============================================================ */

:root {
  --ink: #201f1d;
  --ink-soft: #312f2c;
  --muted: #6d6a64;
  --muted-2: #9c988f;
  --paper: #f7f5f1;
  --paper-2: #ffffff;
  --line: #e8e4dc;
  --line-strong: #d4cfc4;

  --accent: #e8590c;
  --accent-600: #cf4d07;
  --accent-soft: #fdf1e8;

  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;
  --info: #1d4ed8;
  --info-soft: #eff6ff;

  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 18px 40px -12px rgba(15, 23, 42, .22);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent-600); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ---------- Top bar / nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, var(--ink), var(--ink-soft));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .9rem;
  box-shadow: inset 0 0 0 2px rgba(232, 89, 12, .9);
}
.brand .ref { font-size: .72rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.nav-spacer { flex: 1; }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a { color: var(--ink-soft); font-weight: 600; font-size: .92rem; padding: 8px 12px; border-radius: 8px; }
.nav-links a:hover { background: var(--paper); text-decoration: none; }

.lang-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.lang-switch button {
  border: 0; background: var(--paper-2); color: var(--muted);
  padding: 6px 11px; font-weight: 700; font-size: .8rem; cursor: pointer; letter-spacing: .03em;
}
.lang-switch button.active { background: var(--ink); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 700; font-size: .95rem; cursor: pointer;
  padding: 12px 20px; border-radius: var(--radius); border: 1px solid transparent;
  transition: transform .04s ease, box-shadow .15s ease, background .15s ease; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-600); text-decoration: none; box-shadow: var(--shadow-md); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-soft); text-decoration: none; }
.btn-ghost { background: var(--paper-2); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--paper); text-decoration: none; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, #232220 0%, #34322e 100%); color: #fff; padding: 64px 0 72px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(820px 420px at 88% -12%, rgba(232, 89, 12, .20), transparent 62%);
  pointer-events: none;
}
.hero .container { position: relative; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); background: rgba(232,89,12,.12); padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(232,89,12,.3); }
.hero h1 { margin-top: 18px; color: #fff; }
.hero-cards { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-top: 40px; align-items: stretch; }
#hero-map, #hero-map iframe { height: 100%; min-height: 300px; width: 100%; display: block; }
@media (max-width: 860px) { .hero-cards { grid-template-columns: 1fr; gap: 18px; } #hero-map iframe { min-height: 260px; } }
.hero .lead { font-size: 1.16rem; color: #c8d2e0; max-width: 60ch; margin-top: 6px; }
.hero-actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 14px 24px; }
.hero-meta .item { border-left: 2px solid var(--accent); padding-left: 14px; }
.hero-meta .k { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.hero-meta .v { font-size: .82rem; color: var(--muted-2); }

/* ---------- Sections ---------- */
section.block { padding: 56px 0; }
.section-head { max-width: 60ch; margin-bottom: 30px; }
.section-head .kicker { color: var(--accent-600); font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Cards / grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-sm); color: var(--ink);
}
.card h3 { margin-top: 0; }
.card.accent { border-top: 3px solid var(--accent); }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { position: relative; padding: 7px 0 7px 30px; border-bottom: 1px dashed var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: ""; position: absolute; left: 2px; top: 13px; width: 16px; height: 16px;
  border-radius: 5px; background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.checklist.provided li::before { content: "✓"; background: var(--ok); box-shadow: none; color: #fff; font-size: 11px; font-weight: 800; line-height: 16px; text-align: center; }

.callout { display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid #fbd9c4; }
.callout .icon { font-size: 1.4rem; line-height: 1; }
.callout.info { background: var(--info-soft); border-color: #c7d9fb; }
.callout strong { color: var(--ink); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; }
.badge.req { background: var(--bad-soft); color: var(--bad); }
.badge.opt { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.badge.fam { background: var(--info-soft); color: var(--info); }
.badge.tier { background: var(--warn-soft); color: var(--warn); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
table.grid { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.grid th, table.grid td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.grid thead th { background: var(--paper); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); position: sticky; top: 0; }
table.grid tbody tr:hover { background: #fbfcfe; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tr.cat-row td { background: var(--ink); color: #fff; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
table.grid tfoot td { font-weight: 800; background: var(--paper); border-top: 2px solid var(--ink); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink-soft); }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="number"], input[type="password"], textarea, select {
  width: 100%; font-family: inherit; font-size: .95rem; color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--paper-2); transition: border .12s ease, box-shadow .12s ease;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,89,12,.15); }
textarea { resize: vertical; min-height: 80px; }
.input-money { position: relative; }
.input-money input { padding-left: 26px; text-align: right; }
.input-money::before { content: "€"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.fields-grid .field.full { grid-column: 1 / -1; }

/* ---------- Pricing grid (form) ---------- */
.cat-block { border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 22px; overflow: hidden; background: var(--paper-2); }
.cat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--ink); color: #fff; }
.cat-head h3 { margin: 0; color: #fff; font-size: 1.02rem; }
.cat-head .cat-sub { font-size: .82rem; color: var(--muted-2); font-weight: 500; }
.cat-body { padding: 6px 20px 16px; }

.price-line { padding: 14px 0; border-bottom: 1px solid var(--line); }
.price-line:last-child { border-bottom: 0; }
.price-line .pl-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-line .pl-label { font-weight: 600; }
.price-line .pl-unit { font-size: .82rem; color: var(--muted); }
.price-inputs { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.price-inputs .field { margin: 0; min-width: 150px; flex: 1; }
.fam-input .field label { font-size: .78rem; color: var(--info); font-weight: 700; }
.tier-box { margin-top: 10px; border-left: 2px solid var(--warn); padding: 8px 0 4px 14px; }
.tier-row { display: flex; gap: 10px; align-items: end; margin-bottom: 8px; flex-wrap: wrap; }
.tier-row .field { margin: 0; }
.line-est { font-size: .8rem; color: var(--muted); margin-top: 8px; }
.line-est b { color: var(--ink); }

/* ---------- Simulator panel ---------- */
.sim-panel { position: sticky; top: 80px; }
.sim-card { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-lg); }
.sim-card h3 { color: #fff; }
.sim-total { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; }
.sim-total small { font-size: .9rem; font-weight: 600; color: var(--muted-2); }
.sim-rows { margin: 16px 0; border-top: 1px solid rgba(255,255,255,.12); }
.sim-rows .r { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .9rem; }
.sim-rows .r span:first-child { color: var(--muted-2); }
.sim-3y { margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(255,255,255,.2); }

/* mini bar chart for seasonality */
.season-chart { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin-top: 10px; }
.season-chart .bar { flex: 1; background: linear-gradient(180deg, var(--accent), var(--accent-600)); border-radius: 3px 3px 0 0; min-height: 4px; position: relative; }
.season-chart .bar.peak { background: linear-gradient(180deg, #ffd7c2, var(--accent)); }
.season-chart .bar span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: .6rem; color: var(--muted-2); }

/* ---------- Steps / progress ---------- */
.steps { display: flex; gap: 0; margin-bottom: 28px; flex-wrap: wrap; }
.steps .step { flex: 1; min-width: 120px; text-align: center; padding: 12px 8px; border-bottom: 3px solid var(--line); color: var(--muted); font-weight: 600; font-size: .88rem; }
.steps .step.active { border-color: var(--accent); color: var(--ink); }
.steps .step .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--muted); font-size: .78rem; margin-right: 6px; }
.steps .step.active .n { background: var(--accent); color: #fff; }

/* ---------- Dropzone ---------- */
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 34px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; background: var(--paper-2); }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-600); }
.file-list { list-style: none; padding: 0; margin: 14px 0 0; }
.file-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--paper-2); font-size: .88rem; }
.file-list .rm { color: var(--bad); cursor: pointer; font-weight: 700; border: 0; background: none; }

/* ---------- Toast / alerts ---------- */
.alert { padding: 14px 18px; border-radius: var(--radius); margin: 16px 0; font-weight: 500; }
.alert.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bbf7d0; }
.alert.err { background: var(--bad-soft); color: var(--bad); border: 1px solid #fecaca; }
.alert.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a; }

/* ---------- Admin ---------- */
.admin-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .k { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.kpi .v { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rank-1 { color: var(--ok); font-weight: 800; }
.compare-table td.best { background: var(--ok-soft); font-weight: 700; }
.login-card { max-width: 380px; margin: 80px auto; }

/* ---------- Footer ---------- */
footer.site { background: var(--ink); color: var(--muted-2); padding: 40px 0; margin-top: 60px; }
footer.site .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
footer.site a { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-2, .grid-3, .fields-grid { grid-template-columns: 1fr; }
  .hero-meta { grid-template-columns: 1fr 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .sim-panel { position: static; }
  .nav-links a:not(.btn) { display: none; }
}
@media (max-width: 560px) {
  .hero-meta { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}
