/* ============================================================
   DEVISALY — Design System "Maison blanche" haut de gamme
   Ivoire + or champagne + encre noire · typo serif Fraunces
   ============================================================ */

:root {
  /* Palettes */
  --bg: #fbfaf7;          /* fond ivoire */
  --bg-2: #f4f1ea;        /* zones secondaires */
  --bg-3: #ffffff;        /* panels / cartes */
  --bg-4: #f7f4ee;        /* surfaces hover */
  --ink: #1c1a17;         /* texte principal */
  --muted: #6b6459;       /* texte secondaire */
  --faint: #a39a8b;       /* texte tertiaire */

  --gold: #b99652;        /* or principal */
  --gold-2: #8c6d2e;      /* or profond */
  --gold-deep: #7a5e27;
  --gold-line: rgba(185,150,82,.32);
  --gold-bg: rgba(185,150,82,.08);

  --danger: #c0392b;
  --ok: #3d7a4a;

  --line: #e8e3d9;        /* bordures */
  --line-soft: #efebe2;

  --shadow-sm: 0 1px 3px rgba(28,26,23,.05);
  --shadow-md: 0 8px 28px rgba(28,26,23,.09);
  --shadow-lg: 0 20px 50px rgba(28,26,23,.13);

  --radius: 14px;
  --radius-lg: 20px;

  /* Typo */
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

::selection { background: var(--gold); color: #fff; }

/* Halo doré subtil en fond */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1100px 620px at 85% -10%, rgba(185,150,82,.06), transparent 60%),
    radial-gradient(800px 520px at -8% 30%, rgba(185,150,82,.05), transparent 55%);
}
.container, .topbar-inner, .auth-card { position: relative; z-index: 1; }

/* ============ BOUTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; border: 1px solid transparent;
  transition: all .18s ease; letter-spacing: .01em; line-height: 1;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.primary {
  color: #fff;
  background: linear-gradient(160deg, #c6a25c, #b99652 55%, #9a7a35);
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 4px 16px rgba(185,150,82,.28), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(185,150,82,.36), inset 0 1px 0 rgba(255,255,255,.35); }

.btn.ghost {
  color: var(--ink);
  background: var(--bg-3);
  border-color: var(--line);
}
.btn.ghost:hover { border-color: var(--gold); color: var(--gold-2); }

.btn.big { padding: 15px 30px; font-size: 15px; border-radius: 12px; }

/* ============ TOPBAR ============ */
.topbar {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 60;
}
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 6px 24px; display: flex; align-items: center; justify-content: space-between; }

.brand { display: flex; align-items: center; gap: 8px; }
.brand a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #d8b97c, #a9863f);
  box-shadow: 0 1px 5px rgba(185,150,82,.3), inset 0 1px 0 rgba(255,255,255,.5);
}
.brand-mark svg { display: block; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 15px; letter-spacing: .02em; color: var(--ink); line-height: 1; }
.brand-name span { color: var(--gold-2); }
.brand-sub { font-size: 9px; color: var(--faint); letter-spacing: 2px; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 26px; }
.nav > a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; transition: color .15s; }
.nav > a:not(.btn):hover { color: var(--gold-2); }
.nav > a.active { color: var(--gold-2); }
.nav .logout { color: var(--danger); }
.nav .btn { padding: 6px 13px; font-size: 12px; border-radius: 7px; }

/* ============ MENU UTILISATEUR ============ */
.user-menu { position: relative; display: flex; align-items: center; }
.user-menu-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 7px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg-3); cursor: pointer; transition: border-color .15s; height: 27px;
}
.user-menu-btn:hover { border-color: var(--gold); }
.user-menu-btn svg { color: var(--faint); }
.user-avatar {
  width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 11px; color: #fff;
  background: linear-gradient(160deg, #d8b97c, #a9863f);
}
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 8px; display: none; z-index: 70;
}
.user-menu.open .user-dropdown { display: block; }
.user-dropdown .ud-head { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.user-dropdown .ud-name { font-weight: 600; font-size: 14px; }
.user-dropdown .ud-plan { font-size: 12px; color: var(--gold-2); }
.user-dropdown a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  font-size: 14px; color: var(--ink); text-decoration: none; transition: background .12s;
}
.user-dropdown a:hover { background: var(--bg-4); color: var(--gold-2); }
.user-dropdown a.logout { color: var(--danger); }
.user-dropdown a.logout:hover { background: rgba(192,57,43,.08); color: var(--danger); }

/* ============ MENU HAMBURGER ============ */
.hamburger-wrap { position: relative; }
.hamburger {
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  width: 26px; height: 26px; background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 7px; cursor: pointer; padding: 6px;
}
.hamburger span { display: block; height: 1.5px; width: 100%; background: var(--ink); border-radius: 2px; transition: all .3s; }
.hamburger.open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.hamburger-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 280px; max-width: 92vw;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); z-index: 100; display: none; overflow: hidden;
}
.hamburger-menu.open { display: block; }
.hm-section { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.hm-section:last-child { border-bottom: none; }
.hm-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 4px 18px; }
.hm-section a { display: flex; align-items: center; gap: 10px; padding: 10px 18px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; transition: background .12s; }
.hm-section a:hover { background: var(--bg-4); color: var(--gold-2); }
.hm-section a.logout { color: var(--danger); }
.hm-section a.logout:hover { background: rgba(192,57,43,.08); }
.hm-section a svg { opacity: .65; }

/* ============ CONTENEURS / SECTIONS ============ */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px 20px; }
.container.narrow { max-width: 820px; }

.page-head { margin-bottom: 30px; padding-top: 20px; }
.page-head h1 { font-family: var(--font-serif); font-size: 30px; font-weight: 600; letter-spacing: .01em; color: var(--ink); }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 6px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--gold-2); font-weight: 600;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold); }

/* ============ CARTES ============ */
.card, .panel {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.card-title, .panel-title {
  font-family: var(--font-serif); font-weight: 600; font-size: 16px;
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px; color: var(--ink);
}
.card-title .num {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 13px; font-family: var(--font-sans);
  background: var(--gold-bg); color: var(--gold-2); border: 1px solid var(--gold-line);
}
.card-sub { color: var(--faint); font-size: 13px; margin-bottom: 18px; }
.panel-sub { color: var(--faint); font-size: 13px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }

/* ============ FORMULAIRES ============ */
label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); margin: 14px 0 6px; }
select, input[type=number], input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; font-size: 14px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); outline: none;
  font-family: var(--font-sans); transition: border-color .15s, box-shadow .15s;
}
select:focus, input:focus, textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px rgba(185,150,82,.12); background: var(--bg-3);
}
select option { background: var(--bg-3); color: var(--ink); }
textarea { min-height: 84px; resize: vertical; }
input::placeholder { color: var(--faint); }

.region-hint {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 14px;
  border-radius: 9px; background: var(--gold-bg); border: 1px solid var(--gold-line);
  font-size: 13px; color: var(--gold-2);
}

/* ============ PRESTATIONS ============ */
.services-list { display: flex; flex-direction: column; gap: 10px; }
.service-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 14px; transition: border-color .15s;
}
.service-item:hover { border-color: var(--gold-line); }
.service-item .info { flex: 1; min-width: 0; }
.service-item .info select, .service-item .info input[type=text] { background: var(--bg-3); }
.service-item .s-label { font-size: 13px; font-weight: 600; }
.service-item .s-price { font-size: 12px; color: var(--gold-2); margin-top: 3px; }
.service-item .price-wrap { display: flex; align-items: center; gap: 4px; }
.service-item .price { width: 90px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-3); font-size: 13px; text-align: right; outline: none; color: var(--ink); }
.service-item .price:focus { border-color: var(--gold); }
.service-item .price-unit { font-size: 12px; color: var(--faint); }
.service-item .qty { width: 64px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-3); font-size: 13px; text-align: center; outline: none; color: var(--ink); }
.service-item .qty:focus { border-color: var(--gold); }
.service-item .remove {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-3);
  color: var(--faint); cursor: pointer; font-size: 14px; flex-shrink: 0; transition: all .15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.service-item .remove:hover { border-color: var(--danger); color: var(--danger); }

.add-service {
  margin-top: 14px; padding: 11px 18px; border-radius: 10px;
  border: 1px dashed var(--gold-line); background: transparent;
  color: var(--gold-2); cursor: pointer; font-size: 13px; font-weight: 600; width: 100%;
  transition: all .15s;
}
.add-service:hover { background: var(--gold-bg); border-style: solid; }

/* ============ CLIENT ============ */
.client-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.client-fields .full { grid-column: 1 / -1; }

/* ============ BUILDER ============ */
.builder { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
@media (max-width: 820px) { .builder { grid-template-columns: 1fr; } }
.main-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; max-width: 100%; }

.summary-col { position: sticky; top: 84px; }
.summary {
  background: var(--bg-3);
  border: 1px solid var(--gold-line); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow-md);
}
.summary-title { font-family: var(--font-serif); font-weight: 600; font-size: 17px; margin-bottom: 16px; color: var(--gold-2); }
.summary-lines { max-height: 280px; overflow-y: auto; margin-bottom: 14px; }
.summary-line { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.summary-line .sl-label { color: var(--muted); }
.summary-line .sl-price { font-weight: 600; color: var(--ink); }
.summary-empty { color: var(--faint); font-size: 13px; text-align: center; padding: 22px 0; }
.summary-totals { border-top: 1px solid var(--line); padding-top: 14px; }
.summary-totals > div { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 13px; color: var(--muted); }
.tva-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 13px; color: var(--muted); }
.tva-input-wrap { display: flex; align-items: center; gap: 5px; }
.tva-input { width: 60px; padding: 5px 7px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; text-align: center; color: var(--ink); outline: none; }
.tva-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(185,150,82,.12); }
.summary-totals .grand {
  font-family: var(--font-serif); font-size: 24px; font-weight: 600; color: var(--gold-2);
  border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px;
}
.summary-totals .grand span:last-child { font-weight: 700; }
.summary-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.summary-actions .btn { width: 100%; }

.error { color: var(--danger); font-size: 13px; margin-top: 10px; }

/* Bandeau upsell Pro dans le récapitulatif */
.upsell-banner {
  margin-top: 16px; padding: 16px;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  background: var(--gold-bg);
}
.ub-head {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-serif); font-size: 15px; font-weight: 600; color: var(--gold-2);
  margin-bottom: 10px;
}
.ub-list { list-style: none; margin: 0 0 12px; }
.ub-list li { font-size: 13px; color: var(--muted); padding: 4px 0; display: flex; align-items: center; gap: 8px; }
.ub-list li::before { content: "✓"; color: var(--gold); font-weight: 700; }
.upsell-banner .btn { width: 100%; }
.ub-note { text-align: center; color: var(--faint); font-size: 12px; margin-top: 10px; }

/* ---- Verrouillage des prix pour les visiteurs non connectés ---- */
.guest .region-hint,
.guest .service-item .s-price,
.guest .service-item .price-unit,
.guest .summary .summary-totals,
.guest .quote-doc .quote-totals,
.guest .quote-doc .q-price,
.guest .competition .comp-table {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  position: relative;
}
.guest .region-hint::after,
.guest .service-item .s-price::after {
  content: "Connectez-vous pour voir les prix conseillés";
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  text-align: center; color: var(--gold-2); font-weight: 600; font-size: 12px;
  filter: none; z-index: 2; white-space: nowrap;
}
.guest .service-item .s-price::after { font-size: 11px; }
.guest .competition::before {
  content: "Étude de marché réservée aux comptes Pro";
  position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%);
  text-align: center; color: var(--gold-2); font-weight: 600; font-size: 13px; z-index: 3;
  filter: none;
}
.guest .competition { position: relative; }
.guest .quote-doc .quote-totals::before {
  content: "Total réservé aux comptes";
  position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%);
  text-align: center; color: var(--gold-2); font-weight: 600; font-size: 13px; z-index: 3; filter: none;
}

/* ============ RÉSULTAT / DOCUMENT ============ */
.result { display: none; margin-top: 24px; min-width: 0; }
.result.show { display: block; }
#quote-body { min-width: 0; overflow-x: auto; }

.quote-doc { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.quote-doc-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 26px;
  background: linear-gradient(135deg, #a9863f, #c6a25c 55%, #8c6d2e);
  color: #fff;
}
.quote-doc-head .q-title { font-family: var(--font-serif); font-size: 19px; font-weight: 700; }
.quote-doc-head .q-sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.quote-doc-head .q-num { font-family: var(--font-serif); font-size: 14px; font-weight: 700; letter-spacing: 2px; opacity: .9; }

.quote-table { width: 100%; border-collapse: collapse; }
.quote-table thead th {
  text-align: left; padding: 13px 26px; font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--faint); border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.quote-table thead th.num, .quote-table tbody td.num { text-align: right; }
.quote-table tbody td { padding: 15px 26px; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: middle; }
.quote-table tbody tr:last-child td { border-bottom: none; }
.quote-table .q-label { font-weight: 600; color: var(--ink); }
.quote-table .q-detail { color: var(--faint); font-size: 12px; margin-top: 2px; }
.quote-table .q-price { font-family: var(--font-serif); font-weight: 600; color: var(--gold-2); }

.quote-totals { background: var(--bg-2); border-top: 1px solid var(--line); padding: 20px 26px; }
.quote-totals-row { display: flex; justify-content: flex-end; gap: 20px; align-items: center; padding: 5px 0; font-size: 14px; color: var(--muted); }
.quote-totals-row .label { width: 150px; text-align: right; }
.quote-totals-row .value { width: 120px; text-align: right; font-weight: 600; color: var(--ink); }
.quote-totals-row.grand { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.quote-totals-row.grand .label { font-family: var(--font-serif); font-size: 16px; font-weight: 700; color: var(--gold-2); }
.quote-totals-row.grand .value { font-family: var(--font-serif); font-size: 22px; font-weight: 700; color: var(--gold-2); }

/* Étude de marché */
.competition { margin-top: 20px; background: var(--bg-3); border: 1px solid var(--gold-line); border-radius: var(--radius); overflow: hidden; }
.competition h3 { font-family: var(--font-serif); font-size: 15px; font-weight: 600; color: var(--gold-2); padding: 16px 26px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.comp-table { width: 100%; border-collapse: collapse; }
.comp-table th { text-align: left; padding: 11px 26px; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line-soft); }
.comp-table th.num, .comp-table td.num { text-align: right; }
.comp-table td { padding: 11px 26px; border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }
.comp-table tr:last-child td { border-bottom: none; }
.comp-table .c-label { color: var(--ink); font-weight: 500; }
.comp-note { padding: 12px 26px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line-soft); }

/* ============ LANDING ============ */
.hero { text-align: center; padding: 0 0 44px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px;
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold-2);
  background: var(--gold-bg); border: 1px solid var(--gold-line); padding: 8px 18px; border-radius: 40px;
}
.hero .eyebrow::before, .hero .eyebrow::after { content: ""; width: 20px; height: 1px; background: var(--gold); }
.hero h1 {
  font-family: var(--font-serif); font-size: 54px; font-weight: 600; line-height: 1.06;
  letter-spacing: -.01em; color: var(--ink);
}
.hero h1 .accent {
  background: linear-gradient(120deg, #c6a25c, #9a7a35, #a9863f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic;
}
.hero p { color: var(--muted); margin: 18px auto 0; font-size: 16px; max-width: 600px; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; margin-top: 28px; flex-wrap: wrap; align-items: center; }
.hero .trust { display: flex; gap: 28px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.hero .trust span { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.hero .trust .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(185,150,82,.4); }

/* Stats */
.stats-bar {
  display: flex; justify-content: center; gap: 60px;
  background: var(--bg-3);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px 36px; box-shadow: var(--shadow-sm); margin-bottom: 18px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.stats-bar::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.stat { text-align: center; }
.stat .num { font-family: var(--font-serif); font-size: 36px; font-weight: 600; color: var(--gold-2); line-height: 1; }
.stat .lbl { font-size: 12px; color: var(--faint); margin-top: 8px; letter-spacing: 1px; text-transform: uppercase; }

/* Sections */
.section { padding: 6px 0 18px; }
.section-head { text-align: center; margin-bottom: 18px; }
.section-head .eyebrow { justify-content: center; margin-bottom: 10px; }
.section-head .eyebrow::after { content: ""; width: 28px; height: 1px; background: var(--gold); }
.section-head h2 { font-family: var(--font-serif); font-size: 34px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.section-head p { color: var(--muted); margin-top: 12px; max-width: 540px; margin-inline: auto; }

/* Features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature {
  background: var(--bg-3);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-sm); transition: transform .2s, border-color .2s;
}
.feature:hover { transform: translateY(-3px); border-color: var(--gold-line); }
.feature .icon-wrap {
  width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center;
  background: var(--gold-bg); border: 1px solid var(--gold-line); margin-bottom: 16px; color: var(--gold-2);
}
.feature h3 { font-family: var(--font-serif); font-size: 17px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.feature p { color: var(--muted); font-size: 14px; line-height: 1.65; }

/* Marquee métiers */
.marquee { overflow: hidden; position: relative; padding: 6px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 12px; width: max-content; animation: scroll 45s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll { from { transform: translateX(0);} to { transform: translateX(-50%);} }
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 40px;
  padding: 10px 20px; font-size: 13px; font-weight: 500; color: var(--muted);
  box-shadow: var(--shadow-sm); white-space: nowrap; transition: border-color .15s;
}
.chip:hover { border-color: var(--gold-line); color: var(--ink); }
.chip .icon { width: 16px; height: 16px; color: var(--gold); }

/* Témoignages */
.testimonials { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.testimonial {
  background: var(--bg-3);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm);
  position: relative;
}
.testimonial::before {
  content: ""; position: absolute; top: 0; left: 28px; right: 28px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.testimonial .stars { color: var(--gold); font-size: 14px; letter-spacing: 3px; margin-bottom: 14px; }
.testimonial .quote { color: var(--ink); font-size: 14px; line-height: 1.75; font-style: italic; }
.testimonial .author { margin-top: 18px; display: flex; align-items: center; gap: 12px; }
.testimonial .avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 600; font-size: 14px; color: #fff;
  background: linear-gradient(160deg, #d8b97c, #a9863f);
}
.testimonial .name { font-weight: 600; font-size: 14px; }
.testimonial .role { font-size: 12px; color: var(--faint); }

/* Étapes */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 960px; margin: 0 auto; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; box-shadow: var(--shadow-sm); position: relative; text-align: left; }
.step .step-num {
  position: absolute; top: 18px; right: 20px;
  font-family: var(--font-serif); font-size: 40px; font-weight: 600; color: var(--gold-bg); line-height: 1;
}
.step .step-icon {
  width: 46px; height: 46px; border-radius: 11px; margin-bottom: 16px;
  display: grid; place-items: center; color: var(--gold-2);
  background: var(--gold-bg); border: 1px solid var(--gold-line);
}
.step h3 { font-family: var(--font-serif); font-size: 17px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.step p { color: var(--muted); font-size: 14px; line-height: 1.65; }

/* CTA final */
.cta-final {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #f2ecdf, #e9e0cb);
  border: 1px solid var(--gold-line); border-radius: var(--radius-lg);
  padding: 60px 34px; text-align: center; box-shadow: var(--shadow-md); margin-bottom: 70px;
}
.cta-final::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(700px 300px at 50% -20%, rgba(185,150,82,.16), transparent 70%);
}
.cta-final h2 { font-family: var(--font-serif); font-size: 34px; font-weight: 600; color: var(--ink); position: relative; }
.cta-final p { color: var(--muted); margin: 14px auto 28px; max-width: 460px; position: relative; }
.cta-final .free { font-size: 13px; color: var(--faint); margin-top: 16px; position: relative; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 24px 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; }
.footer h4 { font-family: var(--font-serif); font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--gold-2); }
.footer a { display: block; color: var(--muted); text-decoration: none; font-size: 13px; padding: 5px 0; transition: color .15s; }
.footer a:hover { color: var(--gold-2); }
.footer .bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-soft); text-align: center; color: var(--faint); font-size: 12px; }

/* ============ DASHBOARD ============ */
.plan-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  padding: 8px 16px; border-radius: 40px; font-size: 13px; color: var(--muted);
  background: var(--bg-3); border: 1px solid var(--line);
}
.plan-badge b { color: var(--gold-2); font-weight: 600; }
.plan-badge a { color: var(--gold-2); font-weight: 600; text-decoration: none; }
.plan-badge.pro { background: var(--gold-bg); border-color: var(--gold-line); color: var(--gold-2); }
.plan-badge.free { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat-card {
  background: var(--bg-3);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.stat-card .label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.stat-card .value { font-family: var(--font-serif); font-size: 30px; font-weight: 600; color: var(--gold-2); margin-top: 6px; }
.stat-card .value.plain { color: var(--ink); }

.empty { text-align: center; padding: 44px 20px; color: var(--faint); }
.empty .big { font-size: 34px; margin-bottom: 14px; color: var(--gold); }
.empty p { margin-bottom: 18px; }

/* Table devis */
.quote-table { width: 100%; border-collapse: collapse; }
.quote-table th {
  text-align: left; font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--faint); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line);
}
.quote-table td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: middle; }
.quote-table tbody tr { transition: background .12s; }
.quote-table tbody tr:hover td { background: var(--bg-4); }
.quote-table .client { font-weight: 600; color: var(--ink); }
.quote-table .muted { color: var(--muted); }
.quote-table .amount { font-family: var(--font-serif); font-weight: 600; color: var(--gold-2); }
.quote-table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Table leads admin */
.lead-table-wrap { overflow-x: auto; }
.lead-table th:first-child, .lead-table td:first-child { white-space: nowrap; }
.lead-row-new td { background: var(--gold-bg); }
.lead-phone { font-size: 12px; color: var(--faint); }
.lead-msg { max-width: 240px; }
.lead-status-form { margin: 0; }
.lead-status-select { width: auto; padding: 6px 10px; font-size: 13px; border-radius: 7px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg-3); color: var(--muted); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold-2); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ============ PRICING ============ */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; align-items: stretch; }
.plan {
  background: var(--bg-3);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.plan.featured {
  border-color: var(--gold-line);
  box-shadow: var(--shadow-md);
}
.plan.featured::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.plan .tag {
  display: inline-block; align-self: flex-start;
  background: linear-gradient(160deg, #c6a25c, #b99652); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  padding: 5px 14px; border-radius: 40px; margin-bottom: 14px;
}
.plan .name { font-family: var(--font-serif); font-size: 20px; font-weight: 600; color: var(--ink); }
.plan .price { font-family: var(--font-serif); font-size: 46px; font-weight: 600; color: var(--gold-2); margin: 12px 0 4px; }
.plan .price small { font-size: 14px; color: var(--faint); font-weight: 500; }
.plan .desc { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.plan ul { list-style: none; margin-bottom: 22px; flex: 1; }
.plan li { padding: 8px 0; font-size: 14px; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.plan li .check { color: var(--gold-2); font-weight: 700; }
.plan li .x { color: var(--faint); }
.plan li.muted { color: var(--faint); }

.note { text-align: center; color: var(--faint); font-size: 13px; margin-top: 30px; }

/* ============ AUTH ============ */
.auth-body {
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(1000px 600px at 50% -10%, rgba(185,150,82,.08), transparent 60%),
    var(--bg);
}
.auth-card {
  background: var(--bg-3);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 44px; width: 100%; max-width: 420px;
  position: relative; overflow: hidden;
}
.auth-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.auth-card .brand { margin-bottom: 30px; }
.auth-card h1 { font-family: var(--font-serif); font-size: 26px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.auth-card .btn { width: 100%; margin-top: 18px; }
.alt { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.alt a { color: var(--gold-2); font-weight: 600; text-decoration: none; }
.alt a:hover { text-decoration: underline; }
.back { display: inline-block; margin-top: 18px; font-size: 13px; color: var(--faint); text-decoration: none; }
.back:hover { color: var(--gold-2); }

/* Champ mot de passe avec œil */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: none; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--faint); border-radius: 8px;
  transition: color .15s, background .15s;
}
.pw-toggle:hover { color: var(--gold-2); background: var(--bg-4); }
.pw-toggle svg { display: block; }

/* ============ ACCOUNT / PROFILE ============ */
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--muted); font-size: 14px; }
.info-row .value { font-weight: 600; font-size: 14px; color: var(--ink); }
.hint { font-size: 12px; color: var(--faint); margin-top: 8px; }
.hint code { background: var(--bg-2); padding: 2px 6px; border-radius: 5px; color: var(--gold-2); }

/* ============ FLASH ============ */
.flash { padding: 13px 17px; border-radius: 11px; font-size: 13px; margin-bottom: 18px; border: 1px solid; }
.flash.error { background: rgba(192,57,43,.06); border-color: rgba(192,57,43,.25); color: var(--danger); }
.flash.success { background: rgba(61,122,74,.06); border-color: rgba(61,122,74,.25); color: var(--ok); }

/* ============ FOOTER inline (app pages) ============ */
.footer-inline { text-align: center; color: var(--faint); font-size: 12px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line-soft); }

/* ============ LEADS / SITE WEB ============ */
.lead-hero { text-align: center; padding: 40px 0 40px; }
.lead-hero h1 { font-family: var(--font-serif); font-size: 42px; font-weight: 600; line-height: 1.08; color: var(--ink); letter-spacing: -.01em; }
.lead-hero h1 .accent {
  background: linear-gradient(120deg, #c6a25c, #9a7a35, #a9863f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic;
}
.lead-hero p { color: var(--muted); margin: 18px auto 0; font-size: 16px; max-width: 540px; }

.lead-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; max-width: 960px; margin: 0 auto; }
@media (max-width: 820px) { .lead-layout { grid-template-columns: 1fr; } }

.lead-benefits h3, .lead-form-wrap h3 { font-family: var(--font-serif); font-size: 22px; font-weight: 600; margin-bottom: 22px; color: var(--ink); }
.lead-benefit { display: flex; gap: 14px; margin-bottom: 20px; }
.lead-benefit .lb-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--gold-2);
  background: var(--gold-bg); border: 1px solid var(--gold-line);
}
.lead-benefit strong { font-size: 14px; color: var(--ink); display: block; margin-bottom: 2px; }
.lead-benefit p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.lead-note {
  display: flex; align-items: center; gap: 8px; margin-top: 24px;
  padding: 12px 16px; border-radius: 10px; color: var(--gold-2);
  background: var(--gold-bg); border: 1px solid var(--gold-line); font-size: 13px;
}

.lead-form-wrap { background: var(--bg-3); border: 1px solid var(--gold-line); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-md); }
.lead-form-wrap h3 { margin-bottom: 10px; }
.lead-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .lead-row { grid-template-columns: 1fr; } }
.lead-privacy { text-align: center; color: var(--faint); font-size: 12px; margin-top: 12px; }

.lead-success { text-align: center; max-width: 520px; margin: 30px auto; padding: 50px 30px; background: var(--bg-3); border: 1px solid var(--gold-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.lead-success-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 20px; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, #c6a25c, #9a7a35); }
.lead-success h2 { font-family: var(--font-serif); font-size: 26px; font-weight: 600; margin-bottom: 12px; color: var(--ink); }
.lead-success p { color: var(--muted); margin-bottom: 24px; }

/* ============ LEGAL / CGV ============ */
.legal-card h1 { font-family: var(--font-serif); font-size: 28px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.legal-card .updated { color: var(--faint); font-size: 13px; margin-bottom: 22px; }
.legal-card h2 { font-family: var(--font-serif); font-size: 17px; font-weight: 600; margin: 24px 0 10px; color: var(--gold-2); }
.legal-card p, .legal-card li { color: var(--muted); font-size: 14px; line-height: 1.75; }
.legal-card ul { padding-left: 20px; margin: 8px 0; }
.legal-card strong { color: var(--ink); }

/* ============ RÉVÉLATION AU SCROLL ============ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 600px) {
  /* Jamais de débordement horizontal de la page, quel que soit le contenu */
  html, body { overflow-x: clip; width: 100%; max-width: 100%; }
  .topbar-inner { padding: 13px 18px; }
  .hero { padding: 64px 0 44px; }
  .hero h1 { font-size: 38px; }
  .section-head h2 { font-size: 26px; }
  .cta-final h2 { font-size: 26px; }
  .client-fields { grid-template-columns: 1fr; }
  .summary-col { position: static; }
  .page-head h1 { font-size: 24px; }
  .card, .panel { padding: 20px; min-width: 0; }
  .quote-doc-head { flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; }
  /* Compte-rendu : le tableau scroll en interne SANS faire déborder la page */
  #quote-body { width: 100%; max-width: 100%; overflow: visible; }
  .quote-doc { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .quote-table, .comp-table {
    width: 100%;
    min-width: 100%;
    white-space: normal;
    table-layout: auto;
  }
  .quote-table thead th, .quote-table tbody td { padding: 10px 12px; white-space: normal; }
  .comp-table th, .comp-table td { padding: 9px 12px; white-space: normal; }
  .quote-totals { padding: 15px 18px; }
  .quote-totals-row { gap: 10px; }
  .quote-totals-row .label { width: auto; flex-shrink: 0; }
  .quote-totals-row .value { width: auto; flex-shrink: 0; }
  .quote-totals-row.grand .value { font-size: 18px; }
  .competition h3 { padding: 13px 18px; }
  .comp-note { padding: 11px 18px; }
  .nav > a:not(.btn):not(.logout) { display: none; }
  .stats-bar { gap: 26px; padding: 24px 20px; }
  .stat .num { font-size: 28px; }
  .service-item { flex-wrap: wrap; gap: 10px; }
  .service-item .info { flex: 1 1 100%; min-width: 0; }
  .service-item .price-wrap { flex: 1; min-width: 0; }
  .service-item .price { width: 100%; }
  .service-item .qty { flex: 0 0 70px; }
  .service-item .remove { align-self: center; }
  .summary { padding: 20px; }
  .summary-totals .grand { font-size: 21px; }
}
/* Tableaux larges : toujours un scroll interne propre, jamais de débordement page */
@media (max-width: 600px) {
  .result .card { overflow: hidden; }
}
