/* ==========================================================================
   SOS Détective Privé — composants ajoutés à la vitrine statique
   (accordéon légal, modale de service, boutons flottants, bandeau cookies,
   page 404). Chargé après style.css / style-light.css : les couleurs
   utilisent les variables déjà définies par le thème actif.
   ========================================================================== */

/* ---------- accordéon "Informations légales" ---------- */
.legal-accordion { max-width: 860px; margin: 0 auto; display: grid; gap: 14px; }
.legal-accordion details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 26px; }
.legal-accordion summary { cursor: pointer; padding: 18px 0; font-family: var(--font-serif); font-weight: 700; font-size: 1.05rem; color: var(--text); list-style: none; }
.legal-accordion summary::-webkit-details-marker { display: none; }
.legal-accordion summary::after { content: '+'; float: right; color: var(--gold); font-weight: 400; }
.legal-accordion details[open] summary::after { content: '−'; }
.legal-accordion .legal-body { padding: 0 0 24px; color: var(--text-dim); font-size: 0.95rem; }
.legal-accordion .legal-body p { margin: 0 0 1.1em; }
.legal-accordion .legal-body p:last-child { margin-bottom: 0; }

/* ---------- fiche service (modale) ---------- */
.service-card { cursor: pointer; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(5,6,9,0.75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 30px;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.modal-card {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  max-width: 760px; width: 100%; max-height: 86vh; overflow-y: auto;
  transform: translateY(24px) scale(0.97); opacity: 0; transition: transform 0.35s cubic-bezier(.2,.8,.2,1), opacity 0.35s ease;
}
.modal-overlay.is-open .modal-card { transform: translateY(0) scale(1); opacity: 1; }
.modal-hero { height: 240px; background-size: cover; background-position: center; border-radius: 12px 12px 0 0; position: relative; }
.modal-hero::after { content:''; position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,0.1), var(--surface)); }
/* Wrapper à hauteur nulle, épinglé en haut de la zone de scroll : le bouton reste visible même après avoir défilé sous l'image. */
.modal-close-wrap { position: sticky; top: 0; height: 0; z-index: 5; }
.modal-close {
  position: absolute; top: 18px; right: 18px;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3);
  background: rgba(8,9,13,0.55); color: #fff; font-size: 1.1rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s ease;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal-close:hover { background: rgba(8,9,13,0.85); }
.modal-body { padding: 34px 40px 40px; }
.modal-body .eyebrow { display:block; margin-bottom: 10px; }
.modal-body h2 { margin-bottom: 18px; }
.modal-body p { color: var(--text-dim); margin-bottom: 1.1em; }
.modal-body .btn { margin-top: 10px; }
@media (max-width: 600px) { .modal-body { padding: 28px 24px 34px; } .modal-hero { height: 190px; } }

/* ---------- bouton discret : bascule clair / sombre ---------- */
.theme-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 9997;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--text-dim); box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  transition: transform 0.25s ease, color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
  opacity: 0.55; font: inherit; cursor: pointer; padding: 0;
}
.theme-fab:hover { opacity: 1; color: var(--gold-light); border-color: var(--gold-dim); transform: translateY(-2px); }
.theme-fab svg { width: 20px; height: 20px; }
@media (max-width: 600px) { .theme-fab { bottom: 16px; right: 16px; width: 42px; height: 42px; } }

/* ---------- bascule de langue instantanée (FR/EN) ---------- */
.lang-switch button.lang-btn {
  font: inherit; background: none; border: none; color: inherit; cursor: pointer; padding: 2px 3px;
}
.lang-switch button.lang-btn.active { color: var(--gold-light); }
.lang-switch button.lang-btn:hover { color: #fff; }

/* ---------- bouton WhatsApp (en-tête) ---------- */
.whatsapp-cta {
  background: #25d366; color: #fff;
  width: 34px; height: 34px; padding: 0;
  border-radius: 50%; flex-shrink: 0;
}
.whatsapp-cta:hover { background: #20bd5a; transform: translateY(-1px); }
.whatsapp-icon { width: 26px; height: 26px; flex-shrink: 0; }
@media (max-width: 480px) { .whatsapp-cta { width: 32px; height: 32px; } .whatsapp-icon { width: 24px; height: 24px; } }

/* ---------- bandeau de consentement aux cookies ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9998;
  background: var(--surface); border-top: 1px solid var(--line-strong);
  box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
  padding: 20px 24px;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner {
  max-width: var(--container); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cookie-banner p { margin: 0; color: var(--text-dim); font-size: 0.86rem; max-width: 640px; line-height: 1.5; }
.cookie-banner a { color: var(--gold-light); text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn-reject {
  background: transparent; border: 1px solid var(--line-strong); color: var(--text-dim);
  padding: 12px 20px; border-radius: var(--radius); font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.02em; cursor: pointer; font-family: inherit;
}
.cookie-btn-reject:hover { color: var(--text); border-color: var(--gold-dim); }
@media (max-width: 640px) {
  .cookie-banner-inner { flex-direction: column; align-items: stretch; }
  .cookie-banner-actions { justify-content: stretch; }
  .cookie-banner-actions button { flex: 1; }
}

/* ---------- page 404 ---------- */
.error-section { min-height: 72vh; display: flex; align-items: center; padding: 140px 0 80px; }
.error-code { font-family: var(--font-serif); font-weight: 800; font-size: clamp(4rem, 14vw, 9rem); line-height: 1; color: var(--gold-light); margin: 0 0 10px; letter-spacing: -0.03em; }
.error-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

/* ---------- formulaire de mandat ---------- */
.field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.25s ease;
}
.field select:focus { outline: none; border-color: var(--gold); }

.form-section h3 { font-size: 1.35rem; margin-bottom: 4px; }
.form-section .section-note { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; }

.radio-group { display: flex; gap: 24px; flex-wrap: wrap; padding-top: 4px; }
.radio-group label { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--text); text-transform: none; letter-spacing: normal; cursor: pointer; }
.radio-group input[type="radio"] { accent-color: var(--gold); width: 16px; height: 16px; }

.checkbox-field { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-field input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--gold); flex-shrink: 0; }
.checkbox-field label { font-size: 0.88rem; color: var(--text-dim); text-transform: none; letter-spacing: normal; }

.file-field {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface-2);
  transition: border-color 0.2s ease;
}
.file-field:hover { border-color: var(--gold-dim); }
.file-field input[type="file"] { display: block; width: 100%; font-size: 0.85rem; color: var(--text-dim); }

.char-counter { font-size: 0.78rem; color: var(--text-dimmer); margin-top: 6px; }

.vehicule-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  margin-bottom: 14px;
  display: grid;
  gap: 14px;
}
.vehicule-item:last-child { margin-bottom: 0; }

.btn-sm {
  align-self: flex-start;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-light);
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-sm:hover { background: var(--gold-dim); color: var(--surface); }

.gdpr-notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.gdpr-notice a { color: var(--gold-light); }

.signature-pad-wrap { border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; overflow: hidden; }
.signature-pad-wrap canvas { display: block; width: 100%; height: 200px; cursor: crosshair; touch-action: none; }
.signature-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 12px; }

@media (max-width: 640px) {
  .radio-group { gap: 16px; }
}
