/*!
 * qualif.css — Widget de pré-qualification Maîtrise Digitale
 * v3.0 — ajout styles verdict MPA + exemple chiffré
 * Charte : navy #0D1B2A, or #F5A623, beige #F4F1EC
 */

:root {
  --md-navy: #0D1B2A;
  --md-or: #F5A623;
  --md-or-dark: #d4891a;
  --md-beige: #F4F1EC;
  --md-text: #1a1a1a;
  --md-muted: #6b7280;
  --md-success: #16a34a;
  --md-error: #dc2626;
}

/* Bouton flottant */
.md-w-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999998;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--md-or);
  color: var(--md-navy);
  border: none;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(245,166,35,0.35), 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  max-width: calc(100vw - 48px);
}
.md-w-btn:hover {
  background: var(--md-or-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(245,166,35,0.5), 0 4px 10px rgba(0,0,0,0.18);
}
.md-w-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.md-w-btn-label {
  white-space: nowrap;
}
@media (max-width: 480px) {
  .md-w-btn { padding: 12px 18px; font-size: 14px; bottom: 16px; right: 16px; }
  .md-w-btn-label { display: none; }
  .md-w-btn-icon { margin: 0; }
}

/* Modal */
.md-w-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.md-w-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 27, 42, 0.55);
  backdrop-filter: blur(2px);
}
.md-w-panel {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  background: var(--md-beige);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: md-w-rise 0.25s ease;
}
@keyframes md-w-rise {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Close */
.md-w-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--md-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  z-index: 2;
  transition: background 0.15s ease;
}
.md-w-close:hover { background: rgba(0,0,0,0.06); }

/* Progress */
.md-w-progress {
  height: 4px;
  background: rgba(13,27,42,0.08);
}
.md-w-progress-bar {
  height: 100%;
  background: var(--md-or);
  width: 0%;
  transition: width 0.3s ease;
}

/* Body */
.md-w-body {
  padding: 32px 28px 24px;
  overflow-y: auto;
  flex: 1;
}
.md-w-step-num {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--md-or-dark);
  margin-bottom: 10px;
}
.md-w-titre {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--md-navy);
  line-height: 1.3;
}
.md-w-sous {
  margin: 0 0 20px;
  color: var(--md-muted);
  font-size: 14px;
}

/* Choix */
.md-w-choix {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.md-w-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #fff;
  border: 1.5px solid #e5e1da;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--md-text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.08s ease;
  font-family: inherit;
}
.md-w-opt:hover {
  border-color: var(--md-or);
  background: #fffbf3;
}
.md-w-opt:active { transform: scale(0.99); }
.md-w-opt-arrow {
  color: var(--md-or);
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
}
.md-w-opt-multi .md-w-check {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 1.5px solid #c8c3b8;
  border-radius: 5px;
  margin-right: 12px;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.md-w-opt-multi.is-on {
  border-color: var(--md-or);
  background: #fffbf3;
}
.md-w-opt-multi.is-on .md-w-check {
  background: var(--md-or);
  border-color: var(--md-or);
}
.md-w-opt-multi.is-on .md-w-check::after {
  content: '';
  position: absolute;
  top: 3px; left: 6px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* Form */
.md-w-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.md-w-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.md-w-field span {
  font-size: 13px;
  font-weight: 600;
  color: var(--md-navy);
}
.md-w-field input {
  padding: 11px 14px;
  border: 1.5px solid #e5e1da;
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--md-text);
  transition: border-color 0.15s ease;
  font-family: inherit;
}
.md-w-field input:focus {
  outline: none;
  border-color: var(--md-or);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.18);
}
.md-w-note {
  font-size: 12px;
  color: var(--md-muted);
  margin: 0;
}

/* RGPD */
.md-w-rgpd {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--md-muted);
  line-height: 1.5;
  padding: 12px;
  background: rgba(13,27,42,0.04);
  border-radius: 10px;
  margin-top: 4px;
}
.md-w-rgpd input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--md-or);
  flex-shrink: 0;
  cursor: pointer;
}
.md-w-rgpd span { color: var(--md-muted); }

/* Primary button */
.md-w-primary {
  display: inline-block;
  width: 100%;
  padding: 14px 20px;
  background: var(--md-or);
  color: var(--md-navy);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s ease, transform 0.08s ease;
  font-family: inherit;
}
.md-w-primary:hover { background: var(--md-or-dark); }
.md-w-primary:active { transform: scale(0.99); }

/* Flash message */
.md-w-flash {
  background: #fef2f2;
  color: var(--md-error);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
  border: 1px solid #fecaca;
}

/* Loading */
.md-w-loading {
  text-align: center;
  padding: 40px 20px;
}
.md-w-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(13,27,42,0.1);
  border-top-color: var(--md-or);
  border-radius: 50%;
  animation: md-w-spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes md-w-spin { to { transform: rotate(360deg); } }
.md-w-loading p { color: var(--md-muted); margin: 0; }

/* Success */
.md-w-success {
  text-align: center;
  padding: 20px 10px;
}
.md-w-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--md-success);
  color: #fff;
  font-size: 36px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.md-w-success h3 {
  color: var(--md-navy);
  font-size: 22px;
  margin: 0 0 10px;
}
.md-w-success p {
  color: var(--md-muted);
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
}

/* Error */
.md-w-error {
  text-align: center;
  padding: 20px 10px;
  color: var(--md-text);
}
.md-w-error p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.md-w-error strong { color: var(--md-error); }
.md-w-error a { color: var(--md-or-dark); font-weight: 600; }

/* === Simulateur MPA — Verdict & exemple chiffré (v3.0) === */
.md-w-verdict { padding: 4px 0; text-align: center; }
.md-w-verdict-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700; color: #fff;
  margin: 0 auto 16px;
}
.md-w-verdict-ok-top { background: var(--md-success); }
.md-w-verdict-ok-mid { background: var(--md-or); }
.md-w-verdict-nok { background: var(--md-muted); }
.md-w-verdict-titre {
  font-size: 22px; line-height: 1.3; margin: 0 0 8px;
  color: var(--md-navy); font-weight: 700;
}
.md-w-verdict-cat {
  display: inline-block;
  background: var(--md-navy); color: var(--md-or);
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  padding: 6px 14px; border-radius: 999px;
  margin: 4px 0 20px;
}
.md-w-verdict-bloc {
  background: var(--md-beige);
  border-radius: 12px; padding: 16px;
  margin: 0 0 16px; text-align: left;
}
.md-w-verdict-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid #e5e1d8;
  font-size: 14px; color: var(--md-text);
}
.md-w-verdict-row:last-child { border-bottom: 0; }
.md-w-verdict-row strong { color: var(--md-navy); font-size: 16px; }
.md-w-verdict-row-emph { padding: 12px 0; border-top: 2px solid var(--md-or); }
.md-w-verdict-row-emph strong { font-size: 22px; color: var(--md-or-dark); }
.md-w-verdict-exemple {
  background: #fff; border: 2px solid var(--md-or);
  border-radius: 12px; padding: 14px 16px;
  margin: 0 0 18px; text-align: left;
}
.md-w-verdict-exemple-titre {
  margin: 0 0 6px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--md-or-dark);
}
.md-w-verdict-exemple p { margin: 0 0 8px; font-size: 14px; line-height: 1.4; color: var(--md-text); }
.md-w-verdict-exemple-lignes { list-style: none; padding: 0; margin: 8px 0 0; }
.md-w-verdict-exemple-lignes li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0; font-size: 14px;
  border-top: 1px dashed #e5e1d8;
}
.md-w-verdict-exemple-lignes li:first-child { border-top: 0; }
.md-w-verdict-exemple-lignes strong { color: var(--md-success); font-size: 16px; }
.md-w-verdict-exemple-lignes li:last-child strong { color: var(--md-text); }
.md-w-verdict-amo {
  background: #fef9e6; border-left: 3px solid var(--md-or);
  border-radius: 4px; padding: 12px 14px; margin: 0 0 18px; text-align: left;
  font-size: 13px; line-height: 1.5; color: var(--md-text);
}
.md-w-verdict-amo strong { color: var(--md-navy); }
.md-w-verdict-amo a { color: var(--md-or-dark); font-weight: 600; }
.md-w-verdict-detail {
  background: var(--md-beige); border-radius: 8px; padding: 12px 14px;
  margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: var(--md-text);
  text-align: left;
}
.md-w-verdict-info { font-size: 13px; color: var(--md-muted); line-height: 1.5; margin: 0 0 18px; text-align: left; }
.md-w-link {
  background: none; border: 0; color: var(--md-muted);
  font-size: 13px; cursor: pointer; margin-top: 8px; padding: 8px 12px;
  text-decoration: underline;
}
.md-w-link:hover { color: var(--md-text); }
/* Option travaux post-verdict (taille réduite) */
.md-w-opt-sm { padding: 10px 12px !important; font-size: 13px !important; }
.md-w-travaux { gap: 6px; }
.md-w-travaux .md-w-opt-multi { display: flex; }

/* Mobile */
@media (max-width: 480px) {
  .md-w-body { padding: 28px 20px 20px; }
  .md-w-titre { font-size: 18px; }
  .md-w-opt { padding: 12px 14px; font-size: 14px; }
  .md-w-verdict-titre { font-size: 19px; }
  .md-w-verdict-row-emph strong { font-size: 19px; }
  .md-w-verdict-icon { width: 56px; height: 56px; font-size: 30px; }
}
