/* ==========================================================================
   Diagnostic facturation électronique — styles propres au questionnaire
   Complète assets/css/style.css : reprend les mêmes variables de charte.
   ========================================================================== */

body.diagnostic { background: var(--slate-25); }

/* ---------- En-tête allégé (pas de navigation, pour ne pas distraire) ---------- */
.dg-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.dg-head__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 66px;
}
.dg-head__aside {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.dg-head__aside a { font-weight: 600; }
@media (max-width: 620px) { .dg-head__aside span { display: none; } }

/* ---------- Barre de progression ---------- */
.dg-progress { border-top: 1px solid var(--border); background: #fff; }
.dg-progress__track { height: 3px; background: var(--slate-100); }
.dg-progress__bar {
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--blue-600), var(--cyan-400));
  transition: width 0.5s var(--ease);
}
.dg-progress__info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--slate-500);
}
.dg-progress__step { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* ---------- Conteneur et écrans ---------- */
.dg-wrap { max-width: 700px; margin: 0 auto; padding: 0 clamp(1.15rem, 4vw, 2rem); }

.dg-screen { display: none; opacity: 0; transition: opacity 0.32s var(--ease); }
.dg-screen.is-active { display: block; }
.dg-screen.is-visible { opacity: 1; }

.dg-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  margin: clamp(1.5rem, 4vw, 3rem) 0;
}

/* ---------- Écran d'accueil ---------- */
.dg-welcome { text-align: center; }
.dg-welcome h1 {
  font-size: clamp(1.75rem, 4.2vw, 2.6rem);
  margin-top: 1.3rem;
  text-wrap: balance;
}
.dg-welcome__lead {
  font-size: var(--fs-lead);
  color: var(--text-muted);
  line-height: 1.62;
  max-width: 52ch;
  margin: 1.2rem auto 0;
}
.dg-welcome__list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
  max-width: 430px;
  margin: 2rem auto;
  text-align: left;
}
.dg-welcome__meta { margin-top: 1.1rem; font-size: 0.86rem; color: var(--slate-500); }

/* ---------- Question ---------- */
.dg-question h2 {
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  line-height: 1.32;
  text-wrap: balance;
}
.dg-hint {
  margin-top: 0.6rem;
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.dg-body { margin-top: 1.5rem; }

/* Carte de transition entre les blocs */
.dg-transition {
  background:
    radial-gradient(600px 260px at 90% -30%, rgba(127, 178, 242, 0.2), transparent 60%),
    linear-gradient(150deg, var(--ink-2), var(--ink));
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(1.15rem, 2.5vw, 1.6rem);
  margin-bottom: 1.75rem;
  font-size: 0.98rem;
  line-height: 1.6;
  animation: dgFade 0.4s var(--ease);
}
.dg-transition b {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #9ec0f0;
  margin-bottom: 0.5rem;
}

/* ---------- Options ---------- */
.dg-options { display: grid; gap: 0.6rem; }
.dg-option {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  padding: 0.95rem 1.1rem;
  background: var(--slate-25);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 0.96rem;
  line-height: 1.45;
  color: var(--text);
  transition: border-color 0.16s var(--ease), background-color 0.16s var(--ease),
              box-shadow 0.16s var(--ease);
}
.dg-option:hover { background: #fff; border-color: var(--blue-400); }
.dg-option.is-selected {
  background: var(--blue-50);
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 125, 221, 0.12);
}
.dg-mark {
  flex: none;
  width: 20px; height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--slate-300);
  background: #fff;
  display: grid;
  place-items: center;
  transition: border-color 0.16s, background-color 0.16s;
}
.dg-mark--radio { border-radius: 50%; }
.dg-mark--check { border-radius: 6px; }
.dg-option.is-selected .dg-mark { border-color: var(--blue-600); background: var(--blue-600); }
.dg-option.is-selected .dg-mark--radio::after {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff;
}
.dg-option.is-selected .dg-mark--check::after {
  content: "";
  width: 10px; height: 6px;
  border-left: 2.2px solid #fff;
  border-bottom: 2.2px solid #fff;
  transform: rotate(-45deg);
  margin-top: -3px;
}

/* ---------- Encadré d'information ---------- */
.dg-info {
  margin-top: 1.25rem;
  padding: 1rem 1.2rem;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-left: 3px solid var(--blue-500);
  border-radius: 0 12px 12px 0;
  font-size: 0.93rem;
  line-height: 1.55;
  animation: dgFade 0.3s var(--ease);
}
.dg-info b { color: var(--blue-700); }

@keyframes dgFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Échelle ---------- */
.dg-scale { display: flex; gap: 0.6rem; justify-content: center; }
.dg-scale button {
  width: 58px; height: 58px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--slate-25);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.16s, background-color 0.16s, color 0.16s;
}
.dg-scale button:hover { border-color: var(--blue-400); background: #fff; }
.dg-scale button.is-selected {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
}
.dg-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: var(--slate-500);
}

/* ---------- Champs ---------- */
.dg-input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--slate-25);
  font: inherit;
  font-size: 0.96rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.dg-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 4px rgba(59, 125, 221, 0.14);
}
.dg-input.has-error { border-color: #dc2626; }
.dg-sub { margin-top: 0.9rem; animation: dgFade 0.3s var(--ease); }
.dg-sub label { display: block; margin-bottom: 0.4rem; font-size: 0.88rem; color: var(--text-muted); }

/* ---------- Barre de boutons ---------- */
.dg-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
@media (max-width: 520px) {
  .dg-actions { flex-direction: column-reverse; align-items: stretch; }
  .dg-actions .btn { width: 100%; }
  .dg-scale button { width: 48px; height: 48px; font-size: 0.98rem; }
}

.dg-error { margin-top: 0.9rem; font-size: 0.88rem; color: #dc2626; min-height: 1.2em; }

/* ---------- Confirmation ---------- */
.dg-confirm { text-align: center; padding: clamp(1rem, 4vw, 2.5rem) 0; }
.dg-confirm__icon {
  width: 66px; height: 66px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--success);
  box-shadow: 0 0 0 8px rgba(15, 143, 102, 0.12);
}
.dg-confirm__icon svg { width: 30px; height: 30px; }
.dg-confirm h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.dg-confirm p { margin-top: 0.9rem; color: var(--text-muted); }

/* ---------- Étape suivante : rappel téléphonique ---------- */
.dg-next { border-color: var(--blue-100); box-shadow: var(--shadow-lg); }
.dg-next h3 { margin-top: 1.1rem; font-size: clamp(1.2rem, 2.6vw, 1.5rem); }
.dg-field-label {
  margin-top: 1.7rem;
  margin-bottom: 0.7rem;
  font-size: 0.88rem;
  font-weight: 700;
}
.dg-options--row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dg-options--row .dg-option { align-items: center; }
.dg-options--row small { color: var(--text-muted); font-size: 0.82rem; }
@media (max-width: 620px) { .dg-options--row { grid-template-columns: 1fr; } }

.dg-rappel-ok {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.4rem 1.5rem;
  background: #eefaf5;
  border: 1px solid #bfe8d8;
  border-radius: var(--radius);
}
.dg-rappel-ok svg { width: 26px; height: 26px; flex: none; color: var(--success); margin-top: 2px; }
.dg-rappel-ok b { font-size: 1.05rem; }
.dg-rappel-ok p { margin-top: 0.3rem; color: var(--text-muted); }

/* ---------- Pied de page allégé ---------- */
.dg-foot {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--slate-500);
  text-align: center;
}
.dg-foot nav { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: center; margin-top: 0.8rem; }

@media (prefers-reduced-motion: reduce) {
  .dg-screen, .dg-transition, .dg-info { transition: none; animation: none; }
}
