/* Constructeur de devis URBANPOS — composants de base (UX_SYNTHESIS §10.3).
   Tailwind CDN génère les utilitaires ; ici : tokens, composants nommés (@apply n'est pas disponible avec le CDN,
   donc CSS classique avec les couleurs de la palette). */

:root {
  /* piste A « Silent Power » (kit URBANPOS-branding/kit-piste-a, 08/11/2026) : noms historiques conservés, valeurs remplacées.
     bordeaux = bleu nuit #03203D (texte, boutons, en-têtes) · or = Stone Blue (fonds, barres, bordures ; jamais du texte)
     · --marque = Scarlet #EB2F33 (accent rare) · --rouge = erreurs (#B3261E, distinct du rouge de marque). */
  --bordeaux: #03203D; --bordeaux-700: #0B3A66; --bordeaux-100: #DCE6F0;
  --or: #639CC5; --or-600: #2F6A96; --or-100: #E3EEF7;
  --champagne: #9FC3DE;
  --porcelaine: #F3F6F9; --porcelaine-200: #DCE3EA;
  --taupe: #03203D; --taupe-500: #3D5A73; --taupe-200: #DCE3EA; --taupe-100: #EAEFF4;
  --sarcelle: #2F6A96; --sarcelle-100: #E3EEF7;
  --succes: #1D7A3A; --succes-100: #E3F3E8;
  --ambre: #A65400; --ambre-100: #FFF4E0;
  --rouge: #B3261E; --rouge-100: #FBEAE9;
  --marque: #EB2F33;
  --font-display: "Anton", "Arial Narrow", sans-serif;
  --radius-card: 14px;
  --shadow-card: 0 1px 2px rgba(3,32,61,.06), 0 4px 16px rgba(3,32,61,.06);
}

[x-cloak] { display: none !important; }
/* filet mobile : jamais de défilement horizontal du document (clip, pas hidden : ne casse pas position: sticky) */
body { overflow-x: clip; }
.pb-safe { padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabular, .num, .money { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
/* .num = un SEUL montant (span / cellule) : nowrap. Pour un bloc ou une phrase multi-lignes, utiliser .tabular. */
.num { text-align: right; white-space: nowrap; }

/* ---------- typographie ---------- */
.page-title { font-family: var(--font-display); font-size: 26px; line-height: 32px; font-weight: 400; letter-spacing: .01em; text-transform: uppercase; color: var(--bordeaux); }
@media (min-width: 768px) { .page-title { font-size: 34px; line-height: 40px; } }
/* logotype piste A : symbole + URBAN (bleu nuit, ou blanc sur fond foncé) + POS (Scarlet), en Anton */
.logotype { font-family: var(--font-display); font-weight: 400; letter-spacing: .02em; line-height: 1; color: var(--bordeaux); white-space: nowrap; }
.logotype-pos { color: var(--marque); }
.section-title { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--taupe); }
@media (min-width: 768px) { .section-title { font-size: 18px; line-height: 24px; } }
.eyebrow { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--taupe-500); font-weight: 600; }

/* ---------- cartes ---------- */
.card { background: #fff; border: 1px solid var(--taupe-200); border-radius: var(--radius-card); padding: 16px; box-shadow: var(--shadow-card); }
@media (min-width: 768px) { .card { padding: 24px; } }
/* carte uniquement à partir de md (Tailwind CDN ne génère pas de variante md: pour une classe maison) */
@media (min-width: 768px) { .md-card { background: #fff; border: 1px solid var(--taupe-200); border-radius: var(--radius-card); padding: 24px; box-shadow: var(--shadow-card); } }
.card-recommended { border: 2px solid var(--or); }
.kpi { background: var(--porcelaine); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.kpi dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--taupe-500); }
.kpi dd { font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- champs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 500; color: var(--taupe); }
.field-hint { font-size: 13px; color: var(--taupe-500); }
.field-error { font-size: 13px; color: var(--rouge); }
.input {
  height: 48px; width: 100%; border-radius: 12px; border: 1px solid var(--taupe-200); background: #fff;
  padding: 0 12px; font-size: 16px; color: var(--taupe); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #6B8399; }
.input:focus { border-color: var(--bordeaux); box-shadow: 0 0 0 3px var(--bordeaux-100); }
.input-error, .input[aria-invalid="true"] { border-color: var(--rouge); }
.input:disabled { background: var(--porcelaine); color: var(--taupe-500); }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; }
select.input { padding-right: 36px; }

/* ---------- boutons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; min-height: 48px; padding: 0 20px; border-radius: 16px; font-weight: 600; font-size: 15px; line-height: 1;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, opacity .15s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; flex-shrink: 0;   /* min-height : jamais écrasé par flex-1 dans une colonne */
}
@media (max-width: 767px) { .btn-primary:not(.btn-sm) { height: 56px; min-height: 56px; } }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--or-600); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--bordeaux); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--bordeaux-700); }
.btn-primary:active { background: var(--bordeaux-700); }
.btn-secondary { background: #fff; color: var(--taupe); border-color: var(--taupe-200); }
.btn-secondary:hover:not(:disabled) { background: var(--porcelaine); }
.btn-gold { background: var(--or); color: var(--taupe); }
.btn-gold:hover:not(:disabled) { background: var(--or-600); }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; color: var(--sarcelle); text-underline-offset: 2px; background: none; border: 0; padding: 0; cursor: pointer; font-weight: 500; position: relative; }
.btn-ghost::before { content: ""; position: absolute; inset: -10px -8px; }   /* zone tactile ≥ 40 px sans bouger la mise en page */
.btn-ghost:hover { text-decoration: underline; }
.btn-danger { background: var(--rouge); color: #fff; }
.btn-sm { height: 36px; min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
@media (max-width: 767px) { .btn-sm { height: 44px; min-height: 44px; } }
.btn-xl { height: 56px; font-size: 16px; }
.btn-spinner { display: none; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-loading .btn-spinner { display: inline-block; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; height: 36px; width: 36px; border-radius: 10px; color: var(--taupe-500); background: none; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--porcelaine); color: var(--taupe); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- navigation ---------- */
.nav-link { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--taupe); background: none; border: 0; cursor: pointer; white-space: nowrap; }
.nav-link:hover { background: var(--porcelaine); }
.nav-link-active { background: var(--bordeaux-100); color: var(--bordeaux); }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--taupe); background: none; border: 0; cursor: pointer; font-size: 14px; }
.menu-item:hover { background: var(--porcelaine); }
.tab-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--taupe-500); background: none; border: 0; cursor: pointer; }
.tab-link-active { color: var(--bordeaux); }

/* ---------- bandeaux, pastilles, badges ---------- */
.banner { display: flex; align-items: flex-start; gap: 10px; border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 1.4; }
.banner-info { background: var(--porcelaine-200); color: var(--taupe); }
.banner-ambre { background: var(--ambre-100); color: var(--taupe); border: 1px solid rgba(166,84,0,.4); }
.banner-rouge { background: var(--rouge-100); color: var(--rouge); }
.banner-succes { background: var(--succes-100); color: var(--succes); }
.banner-gris { background: var(--taupe-100); color: var(--taupe-500); }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-or { background: var(--or); color: var(--taupe); }
.badge-taupe { background: var(--taupe-100); color: var(--taupe-500); }
.badge-champagne { background: var(--champagne); color: var(--taupe); }
.chip { display: inline-flex; align-items: center; height: 32px; border-radius: 999px; padding: 0 12px; font-size: 14px; border: 1px solid var(--taupe-200); background: #fff; color: var(--taupe); cursor: pointer; white-space: nowrap; flex-shrink: 0; }
@media (max-width: 767px) { .chip { height: 40px; } }
.chip[aria-pressed="true"], .chip-active { background: var(--bordeaux); color: #fff; border-color: var(--bordeaux); }

/* ---------- tuiles / choix ---------- */
.tile { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; text-align: left; background: #fff; border: 2px solid var(--taupe-200); border-radius: 12px; padding: 12px; color: var(--taupe); cursor: pointer; transition: border-color .15s, background .15s; }
.tile:hover:not(.tile-disabled) { border-color: var(--taupe-500); }
.tile-selected, .tile[aria-pressed="true"] { border-color: var(--bordeaux); background: var(--bordeaux-100); }
.tile-recommended { border-color: var(--or); }
.tile-disabled { opacity: .5; cursor: not-allowed; }
.tile:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--or-600); }

/* ---------- jauge de remise ---------- */
.gauge { display: flex; flex-direction: column; gap: 6px; }
.gauge-track { height: 8px; border-radius: 999px; background: var(--taupe-200); overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 999px; transition: width .3s; }

/* ---------- tableau de lignes ---------- */
.table-quote { width: 100%; font-size: 14px; border-collapse: collapse; }
.table-quote th, .table-quote td { padding: 8px; border-bottom: 1px solid var(--taupe-100); vertical-align: top; }
@media (max-width: 767px) { .table-quote th { white-space: normal; } }
.table-quote .line-section th { background: var(--porcelaine); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--taupe-500); text-align: left; }
.table-quote .line-note td { font-style: italic; color: var(--taupe-500); }
.table-quote .line-name { min-width: 200px; }

/* ---------- toasts ---------- */
#toast-root { position: fixed; top: 16px; left: 16px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 768px) { #toast-root { top: auto; bottom: 16px; left: 16px; right: auto; width: auto; max-width: 420px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; border-radius: 12px; background: var(--taupe); color: #fff; padding: 12px 16px; font-size: 14px; box-shadow: var(--shadow-card); animation: toast-in .2s ease-out; }
.toast-success { background: var(--succes); }
.toast-error { background: var(--rouge); }
.toast-warn { background: var(--ambre); }
.toast a, .toast button { color: #fff; text-decoration: underline; background: none; border: 0; cursor: pointer; font: inherit; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- divers ---------- */
.skeleton { background: var(--taupe-200); border-radius: 8px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
/* SPEC D64 / D65 (relecture du 12/11) : la cloche prend ~52 px dans l'en-tête. Quand elle est là, le nom de l'outil (xl) et le
   logotype (lg) s'effacent ; en dessous, la barre de liens défile au lieu de passer sous le bloc de droite. */
header:has(#notif-bell) .entete-outil { display: none !important; }
@media (max-width: 1279.98px) { header:has(#notif-bell) .entete-logotype { display: none !important; } }
@media (min-width: 768px) { .entete-nav { overflow-x: auto; scrollbar-width: none; } .entete-nav::-webkit-scrollbar { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
