/* Multi-step quote form - shared across index.html, /soumission/, /en/, /free-quote/ */

.fs-form {
  --fs-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --fs-ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --fs-gold: #f5b301;
}

/* No-JS fallback: every step stays visible and stacked, form still works. */
.fs-form .fs-step { margin-bottom: 20px; }

/* Only when JS has actually run do we switch to one-question-at-a-time. */
.fs-js-enabled .fs-step {
  display: none;
  transition: transform 220ms var(--fs-ease-out), opacity 220ms var(--fs-ease-out);
}
.fs-js-enabled .fs-step-active {
  display: block;
}
.fs-js-enabled .fs-step-entering {
  opacity: 0;
  transform: translateX(16px);
}
.fs-js-enabled .fs-step-leaving {
  opacity: 0;
  transform: translateX(-16px);
  transition: transform 150ms var(--fs-ease-out), opacity 150ms var(--fs-ease-out);
}

/* Progress stars */
.fs-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
  position: relative;
}
.fs-star {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--border);
  transition: color 300ms var(--fs-ease-pop), transform 300ms var(--fs-ease-pop);
}
.fs-star.fs-star-lit {
  color: var(--fs-gold);
  transform: scale(1.15);
}
.fs-star.fs-star-pop {
  animation: fs-star-pop 300ms var(--fs-ease-pop);
}
@keyframes fs-star-pop {
  0% { transform: scale(1); }
  55% { transform: scale(1.3); }
  100% { transform: scale(1.15); }
}

/* The zone step's label sits above a centered choice grid, so it reads
   better centered too - the typed-field steps keep their labels
   left-aligned above their input, which is the normal/expected pattern. */
.fs-step[data-step="1"] > .form-label {
  text-align: center;
}

/* Zone choice grid */
.fs-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .fs-choice-grid { grid-template-columns: repeat(3, 1fr); }
}
.fs-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 12px 10px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--body);
  text-align: center;
  cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease, box-shadow 200ms ease, transform 160ms ease-out;
}
.fs-choice input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .fs-choice:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }
}
.fs-choice:active { transform: scale(0.97); }
.fs-choice:has(input:checked) {
  border-color: var(--g);
  background: var(--pale);
  color: var(--g-dark);
}
.fs-choice-check {
  display: inline-flex;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 180ms var(--fs-ease-out), transform 180ms var(--fs-ease-out);
}
.fs-choice:has(input:checked) .fs-choice-check {
  opacity: 1;
  transform: scale(1);
}

/* Encouragement micro-copy */
.fs-encourage {
  color: var(--g-dark);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms var(--fs-ease-out), transform 200ms var(--fs-ease-out);
}
.fs-encourage.fs-encourage-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Step nav buttons */
.fs-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.fs-back {
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 4px;
  transition: color 160ms ease;
}
.fs-back:hover { color: var(--body); }
.fs-next[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Ensure typed inputs never trigger iOS auto-zoom */
.fs-form input[type="text"],
.fs-form input[type="tel"] {
  font-size: 16px;
}

/* Success checkmark shown briefly before navigating on real submit */
.fs-success {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 0;
  color: var(--g-dark);
  font-weight: 700;
}
.fs-success svg {
  transform: scale(0.95);
  transition: transform 200ms var(--fs-ease-out);
}
.fs-success.fs-success-visible {
  display: flex;
}
.fs-success.fs-success-visible svg {
  transform: scale(1);
}

/* Delayed "aucun engagement" popup - centered modal with the quote form built in */
.fs-popup {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(13, 20, 13, 0.6);
  opacity: 0;
  transition: opacity 250ms cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
}
.fs-popup.fs-popup-visible {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.fs-popup-card {
  position: relative;
  background: var(--white);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 28px 32px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(12px);
  transition: transform 250ms cubic-bezier(0.23, 1, 0.32, 1);
}
.fs-popup.fs-popup-visible .fs-popup-card {
  transform: scale(1) translateY(0);
}
.fs-popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--off);
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease-out;
  z-index: 1;
}
.fs-popup-close:hover { background: var(--pale); }
.fs-popup-close:active { transform: scale(0.9); }
.fs-popup-eyebrow {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--g-dark);
  margin: 0 0 8px 0;
  text-align: center;
}
.fs-popup-card h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px 0;
  text-align: center;
}
.fs-popup-card p {
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  color: var(--body);
  margin: 0 0 22px 0;
  text-align: center;
}

@media (max-width: 640px) {
  .fs-popup {
    padding: 0;
    align-items: flex-end;
  }
  .fs-popup-card {
    max-width: none;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .fs-js-enabled .fs-step,
  .fs-js-enabled .fs-step-entering,
  .fs-js-enabled .fs-step-leaving,
  .fs-star,
  .fs-star.fs-star-pop,
  .fs-choice,
  .fs-choice-check,
  .fs-encourage,
  .fs-success svg,
  .fs-popup,
  .fs-popup.fs-popup-visible {
    transition: opacity 200ms ease !important;
    animation: none !important;
    transform: none !important;
  }
}
