/*
 * Stop Assurances Core : styles minimaux (formulaires, bandeau cookies, bouton WhatsApp).
 * Variables du theme avec valeurs de repli. Les selecteurs :where() ont une specificite nulle :
 * les regles du theme (.sam-btn, etc.) l'emportent toujours.
 */
.sam-form-wrap {
  --samc-red: var(--sam-red, #c8102e);
  --samc-red-dark: var(--sam-red-dark, #9d0c24);
  --samc-ink: var(--sam-ink, #1c1c1c);
  --samc-cream: var(--sam-cream, #f7f2ea);
  --samc-radius: var(--sam-radius, 8px);
  color: var(--samc-ink);
}
.sam-form { display: block; margin: 0; }
.sam-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.sam-form [hidden], .sam-cookie [hidden], .sam-success[hidden] { display: none !important; }
.sam-form.is-js .sam-step:not(.is-active) { display: none; }
.sam-form:not(.is-js) .sam-step { display: block; }
.sam-form .sam-step__title { font-weight: 700; font-size: 1.125rem; margin: 0 0 1rem; padding: 0; outline: none; }
.sam-form .sam-sr-only, .sam-sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.sam-form .sam-hp {
  position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.sam-form .sam-field { margin: 0 0 1rem; }
.sam-form .sam-label { display: block; font-weight: 600; margin: 0 0 .35rem; padding: 0; }
.sam-form .sam-req { color: var(--samc-red); }
.sam-form input[type="text"],
.sam-form input[type="tel"],
.sam-form input[type="email"],
.sam-form select,
.sam-form textarea {
  display: block; width: 100%; box-sizing: border-box; min-height: 48px; padding: .65rem .8rem;
  font: inherit; color: inherit; background: #fff; border: 2px solid #8b8b8b; border-radius: var(--samc-radius);
}
.sam-form textarea { min-height: 110px; resize: vertical; }
.sam-form input:focus-visible,
.sam-form select:focus-visible,
.sam-form textarea:focus-visible,
.sam-form button:focus-visible {
  outline: 3px solid var(--samc-ink); outline-offset: 2px;
}
.sam-form .has-error input,
.sam-form .has-error select,
.sam-form .has-error textarea { border-color: var(--samc-red-dark); }
.sam-form .sam-radios { display: flex; flex-direction: column; gap: .5rem; }
.sam-form .sam-radio, .sam-form .sam-check { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; line-height: 1.4; }
.sam-form .sam-radio input, .sam-form .sam-check input { flex: 0 0 auto; width: 1.25rem; height: 1.25rem; margin: .1rem 0 0; accent-color: var(--samc-red); }
.sam-form .sam-field--consent { font-size: .875rem; }
.sam-form .sam-field--consent a { color: inherit; text-decoration: underline; }
.sam-error { color: var(--samc-red-dark, #9d0c24); font-size: .875rem; font-weight: 600; margin: .35rem 0 0; }
.sam-error[hidden] { display: none; }
.sam-form .sam-error--global {
  padding: .75rem 1rem; margin: 0 0 1rem; border: 2px solid var(--samc-red-dark); border-radius: var(--samc-radius); background: #fff;
}
.sam-progress { margin: 0 0 1.25rem; }
.sam-progress[hidden] { display: none; }
.sam-progress { height: 8px; background: rgba(0, 0, 0, .12); border-radius: 999px; overflow: hidden; }
.sam-progress > span { display: block; height: 100%; width: 0; background: var(--samc-red); transition: width .25s ease; }
.sam-progress__label { margin: .4rem 0 0; font-size: .875rem; font-weight: 600; }
.sam-form .sam-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }
.sam-form .sam-actions [hidden] { display: none; }
.sam-form.is-js .sam-actions .sam-btn--primary:only-child { width: 100%; }

/* Repli visuel des boutons si le theme n'est pas actif (specificite nulle). */
:where(.sam-form .sam-btn) {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .7em 1.4em;
  font-family: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; border: 2px solid transparent; border-radius: var(--samc-radius, 8px); cursor: pointer;
  background: var(--sam-red, #c8102e); color: #fff;
}
:where(.sam-form .sam-btn--ghost) { background: transparent; color: var(--sam-ink, #1c1c1c); border-color: var(--sam-ink, #1c1c1c); }
:where(.sam-form .sam-btn--next) { background: var(--sam-ink, #1c1c1c); color: #fff; }
.sam-form .sam-btn[disabled] { opacity: .6; cursor: progress; }

.sam-success { padding: 1rem 1.25rem; border: 2px solid var(--samc-red); border-radius: var(--samc-radius); background: var(--samc-cream); outline: none; }
.sam-success[hidden] { display: none; }

/* Mode sans JavaScript : toutes les etapes restent visibles. */
.sam-form:not(.is-js) .sam-step { margin-bottom: 1.5rem; }
.sam-form:not(.is-js) .sam-progress, .sam-form:not(.is-js) .sam-progress__label { display: none !important; }
.sam-form:not(.is-js) .sam-step__title { display: block; }

/* Bouton WhatsApp (repli ; le theme peut le restyler). */
:where(.sam-wa) {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 48px; padding: .6rem 1.1rem;
  background: #25d366; color: #0b3d1e; font-weight: 700; text-decoration: none; border-radius: 999px;
}
:where(.sam-wa svg) { width: 1.4em; height: 1.4em; flex: 0 0 auto; }
.sam-wa--inline { display: inline-flex; }
.sam-wa--float.is-float { position: fixed; right: 14px; bottom: 14px; z-index: 9990; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }

/* Bandeau cookies : Accepter et Refuser ont le meme poids visuel. */
.sam-cookie {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100000; padding: 12px;
  background: #fff; color: #1c1c1c; border-top: 3px solid var(--sam-red, #c8102e);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .15); font-size: .9375rem; line-height: 1.45;
}
.sam-cookie[hidden] { display: none; }
.sam-cookie__inner { max-width: 960px; margin: 0 auto; }
.sam-cookie__title { margin: 0 0 .25rem; font-weight: 700; font-size: 1.0625rem; }
.sam-cookie__text { margin: 0 0 .75rem; }
.sam-cookie__text a { color: inherit; text-decoration: underline; }
.sam-cookie__custom { display: grid; gap: .5rem; margin: 0 0 .75rem; }
.sam-cookie__custom[hidden] { display: none; }
.sam-cookie__opt { display: flex; gap: .6rem; align-items: center; }
.sam-cookie__opt input { width: 1.25rem; height: 1.25rem; accent-color: var(--sam-red, #c8102e); }
.sam-cookie__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.sam-cookie__actions [hidden] { display: none; }
.sam-cookie__actions .sam-btn { flex: 1 1 140px; min-height: 48px; }
:where(.sam-cookie .sam-btn) {
  display: inline-flex; align-items: center; justify-content: center; padding: .6em 1em; font-family: inherit; font-weight: 700; font-size: .9375rem; line-height: 1.2; cursor: pointer;
  color: #fff; background: #1c1c1c; border: 2px solid #1c1c1c; border-radius: var(--sam-radius, 8px);
}
:where(.sam-cookie .sam-btn--ghost) { background: transparent; color: #1c1c1c; }
.sam-cookie .sam-btn:focus-visible { outline: 3px solid var(--sam-red, #c8102e); outline-offset: 2px; }
.sam-cookie-link { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
@media (min-width: 720px) {
  .sam-cookie__actions .sam-btn { flex: 0 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .sam-progress > span { transition: none; }
}
