/* =====================================================================
   Nafa Pièces — thème commun au site et à l'appli (repris des maquettes)
   Styles partagés uniquement : chaque composant garde les siens dans
   son fichier .razor.css.
   ===================================================================== */

:root {
  --ink: #0A1630;
  --ink-2: #33415C;
  --muted: #6B7A93;
  --line: #E4E9F2;
  --bg: #F5F7FB;
  --white: #fff;
  --navy: #061634;
  --blue: #1E5EFF;
  --blue-dark: #1749D1;
  --cyan: #16C7D9;
  --amber: #FFB21E;
  --green: #12B76A;
  --red: #F04438;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(10, 22, 48, .05), 0 18px 40px -18px rgba(10, 22, 48, .22);
  --font-titre: "Sora", system-ui, sans-serif;
  --font-texte: "Manrope", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-texte);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .titre { font-family: var(--font-titre); letter-spacing: -.025em; margin: 0; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--cyan) !important; outline-offset: 3px; }
/* Focus posé par Blazor sur le titre à chaque navigation (accessibilité) : pas de contour visible. */
h1:focus, h1:focus-visible { outline: none !important; }
html, body { overflow-x: hidden; }

.conteneur { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
.muet { color: var(--muted); }
.gras { font-weight: 800; }
.petit { font-size: .86rem; }
.sora { font-family: var(--font-titre); }
.espace-haut { margin-top: 24px; }
.espace-bas { margin-bottom: 24px; }
.ligne { display: flex; align-items: center; gap: 12px; }
.ligne-entre { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.colonne { display: flex; flex-direction: column; gap: 12px; }
.pousse { flex: 1; min-width: 0; }
.cache-mobile { }
.seulement-mobile { display: none; }
@media (max-width: 991px) {
  .cache-mobile { display: none !important; }
  .seulement-mobile { display: initial; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-texte); font-weight: 700; font-size: .95rem;
  border-radius: 14px; padding: .75rem 1.25rem; border: 0; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, transform .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: .45rem .85rem; border-radius: 10px; font-size: .86rem; }
.btn-lg { padding: 1rem 1.5rem; font-size: 1.02rem; border-radius: 16px; }
.btn-bloc { width: 100%; }
.btn-bleu { background: var(--blue); color: #fff; box-shadow: 0 10px 24px -10px rgba(30, 94, 255, .8); }
.btn-bleu:hover { background: var(--blue-dark); color: #fff; }
.btn-ambre { background: var(--amber); color: var(--navy); box-shadow: 0 10px 24px -10px rgba(255, 178, 30, .9); }
.btn-ambre:hover { background: #FFC24D; }
.btn-clair { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-clair:hover { border-color: #C9D3E4; }
.btn-verre { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(8px); }
.btn-verre:hover { background: rgba(255, 255, 255, .18); }
.btn-danger { background: #FEF3F2; color: #B42318; border: 1px solid #FECDCA; }
.btn-icone { width: 42px; height: 42px; padding: 0; border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--ink); }

/* ---------- Puces de statut (§7 : chaque résultat dit ce qu'il est) ---------- */
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .78rem; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.st-ReferenceCorrespondante { background: #EAF0FF; color: #1749D1; }
.st-VisuellementSimilaire { background: #fff; color: var(--ink-2); border: 1.5px dashed #A9B5C9; }
.st-CompatibiliteConfirmee { background: #E3F8EE; color: #0A8A4E; }
.st-InformationsNecessaires { background: #FFF4DB; color: #A0640A; }
.st-neutre { background: #EEF1F6; color: var(--ink-2); }
.st-succes { background: #E3F8EE; color: #0A8A4E; }
.st-alerte { background: #FFF4DB; color: #A0640A; }
.st-danger { background: #FEF3F2; color: #B42318; }
.st-info { background: #EAF0FF; color: #1749D1; }

/* Disponibilité */
.dispo { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.point { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.point-Confirmee { background: var(--green); box-shadow: 0 0 0 4px rgba(18, 183, 106, .16); }
.point-AConfirmer { background: var(--amber); box-shadow: 0 0 0 4px rgba(255, 178, 30, .18); }
.point-SurCommande { background: #98A2B3; }
.point-Indisponible { background: var(--red); box-shadow: 0 0 0 4px rgba(240, 68, 56, .14); }

.prix { font-family: var(--font-titre); font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; white-space: nowrap; }
.prix small { font-size: .72rem; color: var(--muted); font-weight: 700; }
.prix-devis { font-size: .95rem; }
.reference { font-family: var(--font-titre); font-weight: 700; font-size: .82rem; color: var(--blue); }

.puce { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .82rem; color: var(--blue); background: #EAF0FF; border-radius: 999px; padding: 5px 12px; }

/* ---------- Cartes et panneaux ---------- */
.panneau { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panneau-titre { font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; }
.carte-vide { border: 2px dashed #C9D3E4; border-radius: var(--radius); padding: 22px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: rgba(255, 255, 255, .5); }
.note { background: #FFF8E8; border: 1px solid #FFE6AE; border-radius: 16px; padding: 14px 16px; font-size: .9rem; color: #6B4A07; display: flex; gap: 10px; }
.note-info { background: #EAF0FF; border-color: #C9D8FF; color: #1749D1; }
.alerte-erreur { background: #FEF3F2; border: 1px solid #FECDCA; color: #B42318; border-radius: 14px; padding: 12px 14px; font-size: .9rem; font-weight: 600; }

.grille-specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 575px) { .grille-specs { grid-template-columns: 1fr 1fr; } }
.spec { background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.spec span { display: block; font-size: .76rem; color: var(--muted); font-weight: 700; }
.spec b { font-size: .95rem; }

.somme { display: flex; justify-content: space-between; padding: 10px 0; color: var(--ink-2); gap: 12px; }
.somme-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }

/* ---------- En-tête bleu nuit des pages internes ---------- */
.entete-page { background: var(--navy); color: #fff; padding: 40px 0 70px; border-radius: 0 0 32px 32px; position: relative; overflow: hidden; }
.entete-page::before { content: ""; position: absolute; inset: 0; background: radial-gradient(40% 80% at 85% 20%, rgba(30, 94, 255, .45), transparent 70%); pointer-events: none; }
.entete-page .conteneur { position: relative; }
.entete-page h1 { font-weight: 800; font-size: clamp(1.5rem, 3.4vw, 2.5rem); }
.entete-page .surtitre { color: #8EA0C2; font-weight: 600; margin-bottom: 6px; }
.entete-page a { color: #9CC3FF; font-weight: 700; text-decoration: none; font-size: .9rem; }
.chevauche { margin-top: -44px; position: relative; z-index: 2; padding-bottom: 48px; }

/* ---------- Grilles ---------- */
.grille-cartes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1199px) { .grille-cartes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .grille-cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.grille-2 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
.grille-2-egal { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
@media (max-width: 991px) { .grille-2, .grille-2-egal { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Frise de suivi ---------- */
.progression { display: flex; gap: 6px; margin: 18px 0 6px; }
.progression span { flex: 1; height: 8px; border-radius: 8px; background: #E2E8F2; }
.progression span.fait { background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.frise { list-style: none; padding: 0; margin: 0; }
.frise li { display: flex; gap: 16px; padding-bottom: 22px; position: relative; }
.frise li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 2px; background: var(--line); }
.frise li.fait:not(:last-child)::after { background: var(--green); }
.frise .icone { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--bg); color: #98A2B3; }
.frise li.fait .icone { background: #E3F8EE; color: var(--green); }
.frise li.maintenant .icone { background: var(--blue); color: #fff; box-shadow: 0 0 0 6px rgba(30, 94, 255, .15); }
.frise b { display: block; }
.frise small { color: var(--muted); }

/* ---------- Formulaires MudBlazor aux couleurs de la marque ---------- */
.mud-input-outlined-border { border-radius: 14px !important; }
.mud-button-root { text-transform: none !important; font-family: var(--font-texte) !important; font-weight: 700 !important; border-radius: 14px !important; letter-spacing: 0 !important; }
.mud-snackbar { border-radius: 14px !important; font-family: var(--font-texte) !important; }
.mud-dialog { border-radius: 22px !important; }

/* ---------- Impression (devis) ---------- */
@media print {
  .barre-haut, .barre-onglets, .pied, .non-imprime { display: none !important; }
  body { background: #fff; }
  .entete-page { background: #fff; color: var(--ink); padding: 0; }
  .panneau { box-shadow: none; border: 0; }
}

.sprite-pieces { position: absolute; width: 0; height: 0; overflow: hidden; }
