/* ============================================================
   Simulateur prix — feuille de style partagée
   Source de vérité visuelle pour les 11 étapes.
   Vanilla pur, mobile-first, kebab-case.
   ============================================================ */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { min-height: 100vh; overflow-x: hidden; }

/* === TOKENS === */
:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --text: #1F2420;
  --text-soft: #6B6F68;
  --text-secondary: #6B6F68; /* alias */
  --accent: #7A8B6F;
  --accent-dark: #5C6E52;
  --accent-soft: rgba(122, 139, 111, 0.08);
  --accent-medium: rgba(122, 139, 111, 0.15);
  --border: #D8D5CC;
  --error: #B85450;
  --success: #7A8B6F;
  --weekend-tint: rgba(122, 139, 111, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --r-input: 12px;
  --r-card: 16px;
  --r-pill: 999px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* === ACCESSIBILITY === */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* === LAYOUT GRID === */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 32px 160px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 64px;
  align-items: start;
}
.content,
.main {
  max-width: 720px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}

/* === QUESTION HEAD === */
.question-head { margin-bottom: 40px; }
.question-eyebrow,
.step-eyebrow {
  font-size: 13px;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.step-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.question-title {
  font-size: clamp(26px, 3.4vw, 32px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}
.required,
.required-asterisk { color: var(--error); font-weight: 400; }
.question-sub,
.question-subtitle {
  font-size: 15px;
  color: var(--text-soft);
  margin: 0 0 36px;
  max-width: 56ch;
}

/* === INFO / HELP TRIGGER === */
.info-btn,
.info-icon,
.help-trigger {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--text-soft);
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: color 180ms, border-color 180ms;
  flex-shrink: 0;
  padding: 0;
}
.info-btn:hover, .info-btn:focus-visible,
.info-icon:hover, .info-icon:focus-visible,
.help-trigger:hover, .help-trigger:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

/* === FOOTER NAV === */
sim-footer-nav { display: block; }
.footer-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(247, 245, 240, 0.95);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-top: 1px solid var(--border);
}
.footer-nav__inner,
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* === BUTTONS === */
.btn {
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  padding: 0 32px;
  height: 52px;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: background 180ms, border-color 180ms, color 180ms, transform 120ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn--primary,
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}
.btn--primary:active:not(:disabled),
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn--primary:disabled,
.btn-primary:disabled,
.btn--primary.is-disabled,
.btn-primary.is-disabled {
  background: #C5C9C0;
  cursor: not-allowed;
  color: rgba(255,255,255,0.85);
}
.btn--ghost,
.btn--tertiary,
.btn-tertiary {
  background: transparent;
  color: var(--text-soft);
  height: 44px;
  padding: 0 20px;
  border: 0;
  font-weight: 400;
}
.btn--ghost:hover,
.btn--tertiary:hover,
.btn-tertiary:hover { color: var(--text); }
.btn--tertiary[hidden],
.btn-tertiary[hidden] { display: none; }

/* === CARDS — SAFETY NET stacking ============================================
   Garantit que le badge ✓ d'une option sélectionnée passe TOUJOURS au-dessus
   d'une éventuelle illustration .card__mockup, même si une page redéfinit
   localement .card__check / .card__mockup sans z-index.

   Contexte : sur etape-7, les cartes "style de montage" ont une illustration
   SVG (.card__mockup) déclarée APRÈS .card__check dans le DOM. Sans z-index
   explicite, l'ordre source l'emporte → le mockup masque le ✓ blanc et il ne
   reste qu'un demi-cercle vert tronqué en haut à droite.

   Régression : observée puis corrigée 2026-05-15. Ces deux règles globales
   évitent le retour du bug même si la copie inline d'une page est altérée
   par un linter / refacto. NE PAS RETIRER.
   ========================================================================= */
/* Scopé à .card pour éviter de créer un stacking context global sur toute
   classe .card__mockup réutilisée ailleurs (modales/tooltips piégées). */
.card .card__check  { z-index: 2; }
.card .card__mockup { z-index: 1; position: relative; }
/* Ne PAS réutiliser .card__mockup en dehors d'une .card sans revue. */

/* === SIDEBAR PRIX === */
.sidebar,
.sidebar-price {
  position: sticky;
  top: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.sidebar__label,
.sidebar-label {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0 0 8px;
  letter-spacing: 0.01em;
}
.sidebar__amount,
.sidebar-amount {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 32px;
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -0.01em;
  transition: color 300ms;
}
.sidebar__hint,
.sidebar-sub {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.5;
}
.sidebar-context {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
}
.sidebar-context-label {
  font-size: 11px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.sidebar-amount.placeholder { color: var(--text-secondary); }
.sidebar-breakdown {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.sidebar-breakdown-row > span:last-child {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
@keyframes priceFlash {
  0%   { transform: translateY(0);    opacity: 1; }
  50%  { transform: translateY(-3px); opacity: 0.6; }
  100% { transform: translateY(0);    opacity: 1; }
}
.sidebar-amount.flash { animation: priceFlash 320ms ease; }

/* === SAVED PILL / SAVE INDICATOR === */
.saved-pill,
.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(122, 139, 111, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 240ms;
}
.saved-pill.is-visible,
.save-indicator.is-visible,
.save-indicator.visible { opacity: 1; }

/* === PRICE BAR MOBILE === */
.price-bar-mobile {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  z-index: 40;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
  align-items: center;
  justify-content: space-between;
}
.price-bar-mobile .label { font-size: 12px; color: var(--text-soft); }
.price-bar-mobile .amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: var(--accent);
}

/* === SKIP LINK === */
.skip-link-row { text-align: center; margin-top: 16px; }
.skip-link {
  background: none;
  border: 0;
  color: var(--text-soft);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
  text-decoration: none;
}
.skip-link:hover { text-decoration: underline; color: var(--accent-dark); }

/* === ERROR MSG === */
.error-msg {
  margin-top: 24px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #F9ECEB;
  border: 1px solid #E6C6C4;
  color: var(--error);
  font-size: 14px;
  display: none;
  align-items: center;
  gap: 10px;
}
.error-msg.is-visible { display: flex; }
.error-msg svg { flex-shrink: 0; }

/* === HELP PANEL (drawer) === */
.help-overlay,
.help-panel__backdrop,
.info-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 36, 32, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms;
  z-index: 200;
}
.help-overlay.is-open,
.help-panel__backdrop.is-open,
.info-panel-overlay.open { opacity: 1; pointer-events: auto; }

.help-panel,
.info-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  width: min(420px, 90vw);
  background: var(--surface);
  box-shadow: -8px 0 24px rgba(0,0,0,0.06);
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 201;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.help-panel.is-open,
.info-panel.open { transform: translateX(0); }

.help-panel__head,
.info-panel-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.help-panel__title,
.info-panel-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.help-close,
.info-panel-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.help-close:hover,
.info-panel-close:hover { background: var(--border); color: var(--text); }
.help-panel__body,
.info-panel-body {
  padding: 28px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  overflow-y: auto;
}
.help-panel__body p,
.info-panel-body p { margin: 0 0 16px; }
.help-panel__body strong,
.info-panel-body strong { color: var(--accent-dark); font-weight: 600; }

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === MEDIA QUERIES === */
@media (max-width: 1023px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 24px 16px 160px;
  }
  .sidebar,
  .sidebar-price {
    position: fixed;
    bottom: 80px;
    left: 16px;
    right: 16px;
    top: auto;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 80;
    border-radius: 14px;
  }
  .sidebar__label, .sidebar-label { margin-bottom: 0; font-size: 12px; }
  .sidebar__amount, .sidebar-amount { font-size: 26px; }
  .sidebar__hint, .sidebar-sub, .sidebar-context, .sidebar-breakdown { display: none; }
  .price-bar-mobile { display: flex; }
  .footer-nav { padding-bottom: env(safe-area-inset-bottom); }
  .footer-nav__inner, .footer-inner { padding: 14px 20px; }
  .btn { height: 48px; padding: 0 24px; }
  .btn--ghost, .btn--tertiary, .btn-tertiary { height: 40px; padding: 0 16px; }
  .question-title { font-size: 26px; }
  .app-header__inner, .header-inner { padding: 14px 20px; }
  .progress, .progress-track { width: 140px; }
}

@media (max-width: 768px) {
  body { font-size: 15px; }
}

@media (max-width: 480px) {
  .help-panel,
  .info-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70vh;
    transform: translateY(100%);
    border-radius: 16px 16px 0 0;
  }
  .help-panel.is-open,
  .info-panel.open { transform: translateY(0); }
  .question-title { font-size: 24px; }
}

/* === FOOTER NAV : boutons Précédent/Suivant en mode icône-seule ===
   Libère de la place pour la pill prix centrale. Le texte reste dans
   le DOM (a11y / screen readers) mais est masqué visuellement. */
.footer-nav__inner #prev-btn,
.footer-nav__inner #next-btn,
.footer-nav__inner .footer-nav__prev,
.footer-nav__inner .footer-nav__next {
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  font-size: 0;
  line-height: 0;
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.footer-nav__inner #prev-btn::before,
.footer-nav__inner .footer-nav__prev::before {
  content: '←';
  font-size: 22px;
  line-height: 1;
  color: var(--text-soft);
}
.footer-nav__inner #next-btn::before,
.footer-nav__inner .footer-nav__next::before {
  content: '→';
  font-size: 22px;
  line-height: 1;
  color: #fff;
}
.footer-nav__inner #next-btn:disabled::before,
.footer-nav__inner .footer-nav__next:disabled::before {
  color: rgba(255,255,255,0.85);
}
.footer-nav__inner #prev-btn:hover::before,
.footer-nav__inner .footer-nav__prev:hover::before { color: var(--text); }

/* Sur desktop : on peut se permettre les labels, plus d'espace dispo */
@media (min-width: 768px) {
  .footer-nav__inner #prev-btn,
  .footer-nav__inner #next-btn,
  .footer-nav__inner .footer-nav__prev,
  .footer-nav__inner .footer-nav__next {
    width: auto;
    min-width: 0;
    padding: 0 24px;
    font-size: 15px;
    line-height: normal;
  }
  .footer-nav__inner #prev-btn::before,
  .footer-nav__inner #next-btn::before,
  .footer-nav__inner .footer-nav__prev::before,
  .footer-nav__inner .footer-nav__next::before {
    content: none;
  }
}

/* === PILL PRIX INLINE (insérée dans .footer-inner par sim-sticky-price) === */
/* Tant que la pill n'a pas migré dans le footer, on la masque */
body > sim-sticky-price { display: none !important; }

.footer-inner sim-sticky-price,
.footer-nav__inner sim-sticky-price,
sim-footer-nav sim-sticky-price {
  display: flex;
  justify-content: center;
  min-width: 0;
  flex: 1 1 auto;
}
.footer-inner sim-sticky-price[hidden],
.footer-nav__inner sim-sticky-price[hidden],
sim-footer-nav sim-sticky-price[hidden] { display: none !important; }
/* Le footer en deux colonnes (Précédent / Suivant) devient 3 colonnes
   pour intégrer la pill au centre. */
.footer-inner,
.footer-nav__inner {
  justify-content: space-between;
}

.sim-pill-price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface, #fff);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  cursor: pointer;
  color: var(--text);
  transition: border-color 180ms, background 180ms, transform 120ms;
  max-width: 100%;
  min-height: 40px;
}
.sim-pill-price:hover { border-color: var(--accent); }
.sim-pill-price:active { transform: translateY(1px); }
.sim-pill-price:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sim-pill-label {
  font-size: 10px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sim-pill-range {
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  color: var(--accent-dark);
  white-space: nowrap;
}
.sim-pill-chevron {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1;
}
@media (max-width: 380px) {
  .sim-pill-label { display: none; }
  .sim-pill-price { padding: 6px 12px; }
}
@media (min-width: 1024px) {
  /* Sidebar visible côté desktop : pas besoin de la pill */
  .footer-inner sim-sticky-price,
  .footer-nav__inner sim-sticky-price,
  sim-footer-nav sim-sticky-price { display: none !important; }
}

/* === MODAL (utilisée par <sim-modal>) === */
sim-modal.modal-overlay {
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(31, 36, 32, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms;
}
sim-modal.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
sim-modal.modal-overlay[hidden] { display: none; }
sim-modal .modal {
  background: var(--surface, #fff);
  border-radius: 20px;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 24px 28px;
  transform: translateY(20px) scale(0.96);
  transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}
sim-modal.is-open .modal { transform: translateY(0) scale(1); }
sim-modal .modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
sim-modal .modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
}
sim-modal .modal__close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--bg, #F7F5F0);
  color: var(--text-soft, #6B6F68);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
sim-modal .modal__close:hover { color: var(--text); }

/* Modale détail estimation */
.sim-price-modal__range {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  color: var(--accent-dark);
  text-align: center;
  margin: 4px 0 4px;
}
.sim-price-modal__hint {
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
  margin-bottom: 16px;
}
.sim-price-modal__rows .sidebar-breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.sim-price-modal__rows .sidebar-breakdown-row:last-child { border-bottom: 0; }

/* Réserve d'espace pour ne pas masquer le contenu sous le footer-nav */
@media (max-width: 1023px) {
  body[data-step] { padding-bottom: 80px; }
}
@media (min-width: 1024px) {
  body[data-step] { padding-bottom: 96px; }
}

/* === MAJ-02 — Sidebar breakdown : flex pour éviter "de79 €" collés === */
.sidebar-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
}
.sidebar-breakdown-row > span:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}
.sidebar-breakdown-row > span:first-child {
  min-width: 0;
}

/* === MAJ-04 — H1 question-title : garder *, (i) collés au texte === */
.question-title { display: block; }
.question-title > span:first-child { display: inline; }
.question-title .required,
.question-title .required-asterisk {
  display: inline;
  margin-left: 4px;
  white-space: nowrap;
}
.question-title .info-btn,
.question-title .info-icon,
.question-title .help-trigger {
  display: inline-flex;
  vertical-align: middle;
  margin-top: 0;
  margin-left: 8px;
}

/* === MAJ-07 — Masquer la sidebar inline sur mobile (sticky-bar suffit) === */
@media (max-width: 1023px) {
  .sidebar,
  .sidebar-price { display: none !important; }
}


