:root {
  --ink: #07111a;
  --ink-2: #13202b;
  --paper: #ffffff;
  --surface: #f3f7f9;
  --surface-2: #eaf1f4;
  --line: #d7e0e5;
  --muted: #64717c;
  --red: #d20b2f;
  --red-dark: #a50020;
  --blue: #0194d3;
  --blue-dark: #006eab;
  --green: #22a06b;
  --radius: 22px;
  --shadow: 0 18px 55px rgba(7, 17, 26, .10);
  --shadow-soft: 0 10px 30px rgba(7, 17, 26, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(1,148,211,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(1,148,211,.035) 1px, transparent 1px),
    #f5f8fa;
  background-size: 34px 34px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.top-strip { background: var(--ink); color: #dbe4ea; font-size: 12px; font-weight: 800; }
.top-strip__inner { max-width: 1400px; margin: auto; padding: 9px 24px; display: flex; justify-content: space-between; gap: 14px; }
.status { display: inline-flex; align-items: center; gap: 7px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #ffb020; box-shadow: 0 0 0 4px rgba(255,176,32,.13); }

.app-shell { width: min(1400px, calc(100% - 36px)); margin: 0 auto; padding: 18px 0 30px; }
.topbar {
  position: sticky; top: 10px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 13px 15px 13px 20px;
  border: 1px solid rgba(215,224,229,.95); border-radius: 20px;
  background: rgba(255,255,255,.94); box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; min-width: 0; }
.brand img { width: 150px; height: 52px; object-fit: contain; object-position: left center; display: block; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.button {
  appearance: none; border: 1px solid var(--line); border-radius: 12px;
  min-height: 44px; padding: 10px 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 900;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(7,17,26,.10); }
.button:focus-visible { outline: 3px solid rgba(1,148,211,.25); outline-offset: 2px; }
.button--red { color: white; border-color: var(--red); background: linear-gradient(135deg, var(--red), var(--red-dark)); }
.button--blue { color: white; border-color: var(--blue); background: linear-gradient(135deg, var(--blue), var(--blue-dark)); }
.button--dark { color: white; border-color: var(--ink); background: var(--ink); }
.button--ghost { background: white; }
.button--glass { color: white; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.08); }

.hero {
  margin: 22px 0 18px; padding: 38px;
  display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; align-items: center;
  min-height: 410px; overflow: hidden; position: relative;
  border-radius: 26px; color: white; box-shadow: var(--shadow);
  background:
    radial-gradient(circle at 85% 18%, rgba(1,148,211,.34), transparent 29%),
    linear-gradient(125deg, #070d13 0%, #111c26 64%, #062338 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .15; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 35px 35px;
}
.hero::after {
  content: ""; position: absolute; width: 460px; height: 230px; right: -100px; bottom: -70px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 36px; transform: skewX(-25deg);
  background: linear-gradient(135deg, rgba(1,148,211,.22), rgba(1,148,211,.02));
}
.hero__content, .hero__aside { position: relative; z-index: 2; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 11px; text-transform: uppercase; letter-spacing: .17em; font-weight: 950; }
.eyebrow::before { content: ""; width: 43px; height: 5px; border-radius: 999px; background: var(--red); }
.hero h1 { max-width: 810px; margin: 24px 0 18px; font-size: clamp(42px, 5.6vw, 78px); line-height: .92; letter-spacing: -.062em; }
.hero h1 span { position: relative; display: inline-block; }
.hero h1 span::after { content: ""; position: absolute; left: 3px; right: 0; bottom: -8px; height: 7px; border-radius: 999px; background: var(--blue); transform: skewX(-24deg); }
.hero p { max-width: 720px; margin: 0; color: #cfdae1; font-size: 15px; line-height: 1.7; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 25px; }
.hero__aside { display: grid; gap: 13px; }
.hero-logo-card { display: grid; place-items: center; min-height: 180px; border: 1px solid rgba(255,255,255,.14); border-radius: 22px; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.hero-logo-card img { width: 126px; height: 126px; object-fit: contain; border-radius: 26px; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-stats div { padding: 16px 13px; border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: rgba(255,255,255,.07); }
.hero-stats strong { display: block; font-size: 24px; letter-spacing: -.04em; }
.hero-stats span { display: block; margin-top: 3px; color: #c9d6de; font-size: 10px; line-height: 1.35; text-transform: uppercase; letter-spacing: .09em; font-weight: 850; }

.project-card {
  margin-bottom: 18px; padding: 16px 17px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end;
  border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow-soft);
  position: relative; overflow: hidden;
}
.project-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(var(--red), var(--blue)); }
.field label, .mobile-selector label { display: block; margin-bottom: 7px; color: #293640; font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: .045em; }
.field input, .field select, .mobile-selector select {
  width: 100%; min-height: 48px; padding: 11px 13px;
  border: 1px solid #cad5dc; border-radius: 12px; outline: none; background: white; color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field input:focus, .field select:focus, .mobile-selector select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(1,148,211,.12); }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.field--full { grid-column: 1 / -1; }

.mobile-selector { display: none; margin-bottom: 15px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: var(--shadow-soft); }
.workspace { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.sidebar { position: sticky; top: 105px; padding: 10px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); }
.sidebar__title { padding: 10px 12px 8px; color: var(--muted); font-size: 10px; font-weight: 950; letter-spacing: .16em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 4px; }
.nav-button {
  width: 100%; padding: 10px; border: 0; border-left: 4px solid transparent; border-radius: 12px;
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: transparent; color: #3f4b55; font-weight: 850; transition: background .16s ease, color .16s ease;
}
.nav-button:hover { background: var(--surface); color: var(--ink); }
.nav-button__icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); color: var(--blue-dark); font-size: 17px; }
.nav-button.active { border-left-color: var(--red); background: linear-gradient(100deg, #0b141d, #152431); color: white; box-shadow: 0 8px 20px rgba(7,17,26,.16); }
.nav-button.active .nav-button__icon { background: var(--blue); color: white; }
.sidebar__future { margin-top: 10px; padding: 13px; border-radius: 13px; background: #f4f8fa; border: 1px solid #e0e8ec; }
.sidebar__future strong { display: block; margin-bottom: 5px; font-size: 12px; }
.sidebar__future span { display: block; color: var(--muted); font-size: 11px; line-height: 1.45; }
.content-column { min-width: 0; }

.calculator-panel { display: none; scroll-margin-top: 108px; }
.calculator-panel.active { display: block; }
.calculator-card { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow); }
.calculator-head { position: relative; padding: 25px 27px; display: flex; justify-content: space-between; align-items: start; gap: 14px; border-bottom: 1px solid var(--line); }
.calculator-head::before { content: ""; position: absolute; left: 0; top: 0; width: 130px; height: 5px; background: linear-gradient(90deg, var(--red) 0 45%, var(--blue) 45%); }
.calculator-head h2 { margin: 0 0 7px; font-size: 27px; letter-spacing: -.038em; }
.calculator-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.calculator-tag { flex: 0 0 auto; padding: 8px 10px; border: 1px solid #c3e7f7; border-radius: 999px; background: #e9f6fc; color: var(--blue-dark); font-size: 10px; font-weight: 950; text-transform: uppercase; letter-spacing: .11em; }
.calculator-body { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr); }
.form-zone { padding: 27px; border-right: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 4px; }
.checkbox-field { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-size: 13px; font-weight: 800; text-transform: none; letter-spacing: 0; }
.checkbox-field input { width: 19px; height: 19px; margin: 0; accent-color: var(--blue); }
.calculator-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 21px; }
.result-zone { padding: 27px; background: linear-gradient(155deg, #f5f9fb, #edf4f7); }
.result-title { margin-bottom: 13px; color: var(--blue-dark); font-size: 10px; font-weight: 950; text-transform: uppercase; letter-spacing: .16em; }
.result-empty { padding: 45px 10px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.55; }
.result-empty::before { content: "="; width: 50px; height: 50px; margin: 0 auto 13px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 15px; background: white; color: var(--blue); font-size: 25px; font-weight: 950; box-shadow: 0 8px 22px rgba(7,17,26,.07); }
.result-list { display: grid; gap: 10px; }
.result-item { padding: 13px 14px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border: 1px solid #dae4e9; border-radius: 13px; background: white; box-shadow: 0 5px 14px rgba(7,17,26,.035); }
.result-item span { color: #4a5862; font-size: 12px; }
.result-item strong { text-align: right; font-size: 16px; }
.result-item:first-child { position: relative; overflow: hidden; border-color: #09283b; background: linear-gradient(135deg, #07111a, #0b3650); color: white; }
.result-item:first-child::after { content: ""; position: absolute; width: 84px; height: 84px; right: -25px; top: -20px; border-radius: 50%; background: rgba(1,148,211,.20); }
.result-item:first-child span, .result-item:first-child strong { position: relative; z-index: 1; color: white; }
.result-note { margin-top: 15px; padding: 12px 13px; border: 1px solid #f0cbd3; border-left: 4px solid var(--red); border-radius: 12px; background: #fff7f8; color: #7b2738; font-size: 11px; line-height: 1.5; }

.summary-card { margin-top: 22px; padding: 23px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: white; box-shadow: var(--shadow); }
.summary-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--red) 0 33%, var(--blue) 33% 66%, var(--ink) 66%); }
.summary-card__head { margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.section-kicker { display: block; margin-bottom: 4px; color: var(--blue-dark); font-size: 10px; font-weight: 950; text-transform: uppercase; letter-spacing: .13em; }
.summary-card h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.summary-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.summary-content { min-height: 100px; margin: 0; padding: 17px; overflow: auto; border: 1px solid #e0e8ec; border-radius: 14px; background: #f3f7f9; color: #33414c; white-space: pre-wrap; font: 12px/1.72 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.important-note { margin-top: 18px; padding: 17px 19px; display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: start; border: 1px solid #e3d4a5; border-radius: 16px; background: #fffaf0; }
.important-note strong { color: #7e5d00; }
.important-note p { margin: 0; color: #635c49; font-size: 12px; line-height: 1.55; }

footer { margin-top: 28px; padding: 23px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; border-radius: 22px; background: var(--ink); color: #cbd6dd; font-size: 12px; }
footer strong { display: block; margin-bottom: 4px; color: white; font-size: 14px; }
footer span { display: block; }
.footer-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.footer-links a { padding: 9px 11px; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; color: white; text-decoration: none; font-weight: 800; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translate(-50%, 22px); opacity: 0; pointer-events: none; padding: 11px 15px; border-bottom: 3px solid var(--blue); border-radius: 12px; background: var(--ink); color: white; font-size: 13px; font-weight: 850; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .hero__aside { grid-template-columns: 160px 1fr; align-items: stretch; }
  .hero-logo-card { min-height: 130px; }
  .hero-logo-card img { width: 100px; height: 100px; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-selector { display: block; }
  .calculator-body { grid-template-columns: 1fr; }
  .form-zone { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 720px) {
  .top-strip__inner { padding: 8px 12px; }
  .top-strip__inner > span:first-child { display: none; }
  .app-shell { width: min(100% - 20px, 1400px); padding-top: 10px; }
  .topbar { top: 6px; padding: 10px 11px; border-radius: 17px; }
  .brand img { width: 118px; height: 42px; }
  .desktop-only { display: none; }
  .top-actions .button { min-height: 40px; padding: 8px 10px; font-size: 11px; }
  .hero { min-height: 0; margin-top: 12px; padding: 27px 21px; border-radius: 21px; }
  .hero h1 { font-size: 44px; }
  .hero p { font-size: 13px; }
  .hero__aside { grid-template-columns: 1fr; }
  .hero-logo-card { display: none; }
  .project-card { grid-template-columns: 1fr; }
  .calculator-head { display: block; padding: 22px 21px; }
  .calculator-tag { display: inline-block; margin-top: 12px; }
  .calculator-head h2 { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .form-zone, .result-zone { padding: 20px; }
  .summary-card__head { align-items: flex-start; flex-direction: column; }
  .summary-actions { width: 100%; }
  .summary-actions .button { flex: 1; }
  .important-note { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; text-align: center; }
  .footer-links { justify-content: center; }
}

@media (max-width: 430px) {
  .hero__actions { display: grid; }
  .hero__actions .button { width: 100%; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  #copyButton { font-size: 0; }
  #copyButton::after { content: "Copier"; font-size: 11px; }
  .result-item { align-items: flex-start; }
}

@media print {
  body { background: white; }
  .top-strip, .topbar, .hero, .project-card, .mobile-selector, .sidebar, .form-zone, .calculator-head .calculator-tag, .summary-actions, .important-note, footer, .toast { display: none !important; }
  .app-shell { width: 100%; padding: 0; }
  .workspace { display: block; }
  .calculator-panel { display: none !important; }
  .calculator-panel.active { display: block !important; }
  .calculator-card, .summary-card { border: 0; box-shadow: none; }
  .calculator-head { padding: 0 0 18px; }
  .calculator-body { display: block; }
  .result-zone { padding: 0; background: white; }
  .summary-card { padding: 24px 0 0; }
}


/* V6 — commandes fournisseurs et exports */
.result-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;padding-top:14px;border-top:1px solid rgba(20,46,70,.12)}
.result-actions .button{font-size:.82rem;padding:10px 12px}
.summary-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.email-dialog{width:min(680px,calc(100% - 28px));border:0;border-radius:22px;padding:0;box-shadow:0 24px 70px rgba(0,0,0,.28)}
.email-dialog::backdrop{background:rgba(5,13,22,.66);backdrop-filter:blur(4px)}
.email-dialog form{padding:24px;background:#fff}
.email-dialog__head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:20px}
.email-dialog__head h2{margin:4px 0 0}
.dialog-close{border:0;background:#eef3f7;width:38px;height:38px;border-radius:50%;font-size:1.6rem;cursor:pointer}
.email-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.email-grid textarea{width:100%;resize:vertical;min-height:130px;border:1px solid #cbd6df;border-radius:12px;padding:12px;font:inherit}
.email-help{font-size:.86rem;color:#607080;background:#f3f7fa;border-radius:12px;padding:12px;margin:16px 0}
.dialog-actions{display:flex;justify-content:flex-end;gap:10px}
@media(max-width:760px){.summary-actions{justify-content:stretch}.summary-actions .button{flex:1 1 145px}.email-grid{grid-template-columns:1fr}.email-dialog form{padding:18px}.result-actions .button{flex:1 1 145px}}
@media print{.top-strip,.topbar,.hero,.project-card,.mobile-selector,.sidebar,#calculatorPanels,.important-note,footer,.summary-actions{display:none!important}.workspace,.content-column{display:block!important}.summary-card{box-shadow:none!important;border:0!important}.summary-content{font-size:12pt;white-space:pre-wrap}.app-shell,main{background:#fff!important}}


/* V2.4 — installation mobile */
.button--install {
  border: 1px solid rgba(30,115,240,.28);
  background: linear-gradient(135deg, #eaf2ff, #ffffff);
  color: #0d4ea3;
}
.button--install:hover { border-color: #1e73f0; background: #e5efff; }

.install-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: calc(100vh - 30px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 26px 80px rgba(0,0,0,.3);
}
.install-dialog::backdrop {
  background: rgba(5,13,22,.68);
  backdrop-filter: blur(5px);
}
.install-dialog__content { padding: 26px; background: #fff; }
.install-dialog__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.install-dialog__head h2 { margin: 4px 0 0; font-size: 28px; }
.install-intro { margin: 18px 0; color: #536472; line-height: 1.6; }
.install-platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.install-platform {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 13px;
  padding: 18px;
  border: 1px solid #dce6ec;
  border-radius: 17px;
  background: #f8fbfd;
}
.install-platform h3 { margin: 0 0 7px; font-size: 18px; }
.install-platform p, .install-platform li {
  color: #586976;
  font-size: 13px;
  line-height: 1.55;
}
.install-platform ol { margin: 0; padding-left: 19px; }
.install-platform__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #1e73f0;
  color: #fff;
  font-weight: 950;
  font-size: 20px;
}
.install-platform__icon--apple { background: #0d1726; }
.install-platform .button { width: 100%; margin-top: 10px; }
.install-help {
  margin: 15px 0 0;
  padding: 12px 14px;
  border-left: 4px solid #1e73f0;
  border-radius: 10px;
  background: #eef5ff;
  color: #38536d;
  font-size: 12px;
  line-height: 1.55;
}
@media (max-width: 720px) {
  .install-platforms { grid-template-columns: 1fr; }
  .install-dialog__content { padding: 20px; }
  .button--install { font-size: 0 !important; }
  .button--install::after { content: "Installer"; font-size: 11px; }
}
