/* ══════════════════════════════════════════════════
   POPUP PRÉ-DIAGNOSTIC
   Pédagogie Retraite — Intégré au thème navy
══════════════════════════════════════════════════ */

.diag-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 22, 45, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 10000;
  padding: 40px 24px;
  overflow-y: auto;
  animation: diag-fade .25s ease;
}
.diag-overlay.is-open {
  display: flex;
}

@keyframes diag-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes diag-slide-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.diag-modal {
  position: relative;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 40px 48px 36px;
  max-width: 780px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  animation: diag-slide-up .35s ease;
  font-family: 'DM Sans', -apple-system, sans-serif;
  margin: auto;
}

.diag-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.diag-close:hover {
  background: rgba(201, 168, 76, .15);
  color: var(--gold);
  border-color: var(--gold);
}

.diag-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 26px;
  padding-right: 36px;
}
.diag-head-icon {
  width: 56px;
  height: 56px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dk));
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(201, 168, 76, .28);
}
.diag-head-icon-result {
  background: linear-gradient(135deg, var(--azure), var(--azure-dk));
  color: #fff;
  box-shadow: 0 8px 22px rgba(91, 163, 217, .3);
}
.diag-head h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.15;
}
.diag-head p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════
   FORM
══════════════════════════════════════════════════ */

.diag-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.diag-required-hint {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin: 6px 0 0;
  text-align: center;
}
.diag-req {
  color: var(--gold);
  font-weight: 600;
}
.diag-civilite-group {
  display: flex;
  gap: 12px;
}
.diag-civilite-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--ink);
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: all .2s;
}
.diag-civilite-option:has(input:checked) {
  border-color: var(--gold);
  background: rgba(201,168,76,.08);
  color: var(--gold);
}
.diag-civilite-option input[type="radio"] {
  display: none;
}
.diag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.diag-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.diag-field label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.2px;
}
.diag-field input[type="text"],
.diag-field input[type="email"],
.diag-field input[type="date"],
.diag-field select {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all .2s;
  width: 100%;
}
.diag-field input::placeholder {
  color: var(--ink-muted);
}
.diag-field input:focus,
.diag-field select:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, .15);
}
.diag-field input[type="date"] {
  color-scheme: dark;
}
.diag-field input:invalid:not(:placeholder-shown) {
  border-color: rgba(239, 68, 68, .5);
}
.diag-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.diag-field select option {
  background: var(--surface);
  color: var(--ink);
}

/* Dropzone */
.diag-dropzone {
  position: relative;
  background: rgba(91, 163, 217, .04);
  border: 2px dashed var(--border);
  border-radius: 2px;
  padding: 22px;
  cursor: pointer;
  transition: all .2s;
}
.diag-dropzone:hover {
  border-color: var(--azure);
  background: rgba(91, 163, 217, .08);
}
.diag-dropzone.is-dragover {
  border-color: var(--gold);
  background: rgba(201, 168, 76, .08);
  transform: scale(1.01);
}
.diag-dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  pointer-events: none;
}
.diag-dropzone-empty i {
  font-size: 1.8rem;
  color: var(--azure);
  margin-bottom: 4px;
}
.diag-dropzone-empty span {
  font-size: 0.88rem;
  color: var(--ink);
}
.diag-dropzone-empty .diag-dropzone-hint {
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-top: 2px;
}
.diag-dropzone-file {
  display: flex;
  align-items: center;
  gap: 14px;
}
.diag-dropzone-file i {
  font-size: 1.6rem;
  color: var(--gold);
  flex-shrink: 0;
}
.diag-file-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.diag-file-meta span:first-child {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diag-file-meta span:last-child {
  font-size: 0.72rem;
  color: var(--ink-muted);
}
.diag-file-remove {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  width: 32px;
  height: 32px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
.diag-file-remove:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, .5);
}

/* Privacy shield — bannière rassurante */
.diag-privacy-shield {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(91, 163, 217, .08), rgba(16, 185, 129, .04));
  border: 1px solid rgba(91, 163, 217, .25);
  border-left: 3px solid var(--azure);
  border-radius: 2px;
  margin: 4px 0 2px;
}
.diag-privacy-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 2px;
  background: rgba(91, 163, 217, .15);
  color: var(--azure);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: 1px solid rgba(91, 163, 217, .3);
}
.diag-privacy-text {
  flex: 1;
  min-width: 0;
}
.diag-privacy-text strong {
  display: block;
  font-size: 0.85rem;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.diag-privacy-text p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.55;
}
.diag-privacy-text p strong {
  display: inline;
  font-size: inherit;
  color: var(--ink);
  font-weight: 600;
  margin: 0;
}

/* Consent */
.diag-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.5;
  cursor: pointer;
  padding: 6px 0;
}
.diag-consent input {
  margin-top: 2px;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.diag-consent a {
  color: var(--gold);
  text-decoration: underline;
}

/* L'attribut HTML [hidden] doit toujours l'emporter sur les display explicites */
[class^="diag-"][hidden],
[class*=" diag-"][hidden] {
  display: none !important;
}

/* Error */
.diag-error {
  background: rgba(239, 68, 68, .1);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 2px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.diag-error::before {
  content: "\f06a";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

/* Submit */
.diag-submit {
  width: 100%;
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dk));
  color: var(--bg);
  border: none;
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all .25s;
  box-shadow: 0 8px 24px rgba(201, 168, 76, .25);
}
.diag-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(201, 168, 76, .35);
}
.diag-submit:disabled {
  background: rgba(201, 168, 76, .25);
  color: rgba(10, 40, 80, .85);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 1;
}

.diag-reassure {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 4px;
}
.diag-reassure span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.diag-reassure i {
  color: var(--gold);
}

/* ══════════════════════════════════════════════════
   PROGRESS
══════════════════════════════════════════════════ */

.diag-progress {
  padding: 16px 0 8px;
}
.diag-progress-head {
  text-align: center;
  margin-bottom: 20px;
}
.diag-progress-head h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  color: var(--ink);
  margin: 0 0 6px;
  font-weight: 500;
}
.diag-progress-head p {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0;
}
.diag-progress-bar {
  height: 6px;
  background: rgba(91, 163, 217, .1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 22px;
}
.diag-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--azure));
  border-radius: 3px;
  transition: width .8s ease;
}
.diag-progress-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.diag-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
  transition: all .3s;
}
.diag-step i {
  width: 22px;
  text-align: center;
  font-size: 1rem;
  color: var(--ink-muted);
  opacity: 0.5;
}
.diag-step.is-active {
  color: var(--ink);
  font-weight: 600;
}
.diag-step.is-active i {
  color: var(--gold);
  opacity: 1;
}
.diag-step.is-done {
  color: var(--ink-soft);
}
.diag-step.is-done i {
  color: var(--azure);
  opacity: 1;
}

/* ══════════════════════════════════════════════════
   RESULT — fiabilité, stats, exemples, CTA
══════════════════════════════════════════════════ */

.diag-fiab {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(91, 163, 217, .1), rgba(91, 163, 217, .03));
  border: 1px solid rgba(91, 163, 217, .18);
  border-radius: 2px;
  margin-bottom: 22px;
}
.diag-fiab-ring {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.diag-fiab-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .05);
}
.diag-fiab-num {
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -1.5px;
}
.diag-fiab-slash {
  font-size: 0.62rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-weight: 600;
  margin-top: 4px;
}
.diag-fiab-right {
  flex: 1;
}
.diag-fiab-label {
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.diag-fiab-label strong {
  color: var(--gold);
  font-weight: 700;
}
.diag-fiab-desc {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* Stats */
.diag-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}
.diag-stat {
  flex: 1;
  padding: 16px 12px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: 2px;
  text-align: center;
}
.diag-stat-num {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.diag-stat-lbl {
  font-size: 0.7rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 6px;
  line-height: 1.3;
}
.diag-stat-alert {
  background: rgba(239, 68, 68, .08);
  border-color: rgba(239, 68, 68, .25);
}
.diag-stat-alert .diag-stat-num {
  color: #f87171;
}
.diag-stat-alert .diag-stat-lbl {
  color: #fca5a5;
  font-weight: 600;
}

/* Examples */
.diag-examples {
  padding: 16px 18px;
  background: rgba(201, 168, 76, .05);
  border: 1px solid rgba(201, 168, 76, .18);
  border-radius: 2px;
  margin-bottom: 22px;
}
.diag-examples h4 {
  font-size: 0.88rem;
  color: var(--ink);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.diag-examples h4 i {
  color: var(--gold);
}
.diag-examples ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.diag-examples li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.87rem;
  color: var(--ink);
  padding: 10px 12px;
  background: rgba(255, 255, 255, .03);
  border-radius: 2px;
  border-left: 3px solid #ef4444;
  line-height: 1.4;
}
.diag-ex-year {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  color: #f87171;
  font-size: 1.05rem;
  min-width: 48px;
}
.diag-ex-desc {
  flex: 1;
}
.diag-examples-more {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 8px;
}
.diag-examples-more i {
  color: var(--gold);
}

/* CTA upsell */
.diag-cta {
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--gold);
  border-radius: 2px;
  padding: 24px 26px;
  text-align: center;
}
.diag-cta h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 8px;
}
.diag-cta p {
  font-size: 0.87rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 18px;
}
.diag-cta p strong {
  color: var(--ink);
}
.diag-cta-btn {
  width: 100%;
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  color: var(--bg);
  border: none;
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 26px rgba(201, 168, 76, .3);
  transition: all .25s;
}
.diag-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(201, 168, 76, .4);
}
.diag-cta-guarantee {
  margin-top: 12px !important;
  font-size: 0.78rem !important;
  color: var(--ink-muted) !important;
}
.diag-cta-guarantee i {
  color: var(--gold);
  margin-right: 4px;
}

/* ══════════════════════════════════════════════════
   Pré-paiement
══════════════════════════════════════════════════ */

.diag-modal-prepay {
  max-width: 520px;
}
.prepay-detail {
  margin: 20px 0;
}
.prepay-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  color: var(--ink);
}
.prepay-table th {
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.prepay-table td {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prepay-table tfoot td {
  border-bottom: none;
  padding-top: 16px;
  font-size: 1rem;
}
.prepay-col-price {
  text-align: right;
  white-space: nowrap;
  width: 90px;
}
.prepay-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 3px;
  line-height: 1.4;
}
.prepay-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--ink);
  margin: 22px 0 20px;
  cursor: pointer;
  user-select: none;
}
.prepay-checkbox-label a {
  color: var(--gold);
  text-decoration: underline;
}
.prepay-checkbox-label a:hover {
  color: var(--gold-lt);
}
.prepay-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}
.prepay-pay-btn {
  margin-top: 4px;
}
.prepay-pay-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ══════════════════════════════════════════════════
   Responsive
══════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .diag-overlay {
    padding: 20px 14px;
  }
  .diag-modal {
    padding: 28px 22px 26px;
  }
  .diag-grid {
    grid-template-columns: 1fr;
  }
  .diag-fiab {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }
  .diag-stats {
    flex-direction: column;
  }
}
