/* ==========================================================================
   Contact — message form (fields, subject pills, submit), plus the two
   "ways to reach us" cards above it. Those cards reuse .products__grid/
   .products__card from products.css with a --fast/--detailed color
   modifier pair (green/blue, echoing the --circuit/--parcours accent-bar
   pattern). js/contact-form.js wires up the single-select subject pills;
   js/formspree.js handles submission and the fields->success step swap.
   Blocks: .contact-form, .cf-row, .cf-field, .cf-subjects, .cf-pill,
           .cf-step, .fs-form-message, .fs-field-error,
           .products__card--fast, .products__card--detailed, .contact-details,
           .availability, .quick-fact
   ========================================================================== */

/* "Nous joindre" header sits left-aligned instead of the shared
   .section__header's default centered treatment (section.css). */
.section__header--left {
  align-self: flex-start;
  text-align: left;
}

.products__card--fast::before {
  background: var(--color-apple-green);
  opacity: 0.16;
}

.products__card--fast .eyebrow {
  color: var(--color-apple-green);
}

/* Quick fact — a single static label/value row pre-empting the "how much
   does this cost" objection right before the CTA, mirroring the
   .contact-detail label/value rhythm in the card beside it (same system,
   green instead of blue since this lives in the --fast card). */
.quick-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

.quick-fact__q {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.quick-fact__a {
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-apple-green);
}

/* Availability signal — a small pulsing dot + response-time note, earning
   the --fast card's "Rapide" label with an actual expectation instead of
   just the badge. */
.availability {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: calc(-1 * var(--space-3));
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.availability__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-apple-green);
  animation: availability-pulse 2s ease-in-out infinite;
}

@keyframes availability-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.45);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(52, 199, 89, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .availability__dot {
    animation: none;
  }
}

.products__card--detailed::before {
  background: var(--color-apple-blue);
  opacity: 0.16;
}

.products__card--detailed .eyebrow {
  color: var(--color-apple-blue);
}

/* Phone/email as a label/value spec row — the same eyebrow typography
   used everywhere else on the site, with an underline reveal on the value
   borrowed from .navbar__link's hover mechanic, rather than a generic
   icon-in-a-circle chip. */
.contact-details {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-2);
  border-top: 1px solid var(--glass-border);
}

.contact-detail {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--glass-border);
}

.contact-detail:last-child {
  border-bottom: none;
}

.contact-detail__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.contact-detail__value {
  position: relative;
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  transition: color var(--transition-fast);
}

.contact-detail__value::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--color-apple-blue);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-fast);
}

.contact-detail:hover .contact-detail__value {
  color: var(--color-apple-blue);
}

.contact-detail:hover .contact-detail__value::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Card chrome matches .modal__card (css/components/modal.css) — this is
   the same "Contactez-nous" form as the popup modal, just embedded in the
   page instead of overlaying it, so it should read as the same surface. */
.contact-form {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-7);
  background: var(--color-white);
  border: 1px solid rgba(44, 44, 46, 0.32);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(23, 24, 27, 0.28);
}

/* Bare modifier — keeps the flex/gap field layout but drops the card
   chrome, for use inside something that already provides it (e.g. the
   "Contactez-nous" modal's .modal__card). */
.contact-form--bare {
  max-width: none;
  margin-inline: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.cf-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cf-field label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.cf-optional {
  font-weight: 400;
  color: var(--color-text-muted);
}

.cf-field input,
.cf-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--color-text-primary);
  background: var(--color-surface-50);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  outline: none;
  resize: none;
  box-shadow: 0 1px 3px rgba(44, 44, 46, 0.06);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.cf-field input:hover,
.cf-field textarea:hover {
  box-shadow: 0 4px 12px rgba(44, 44, 46, 0.18);
}

.cf-field input:focus,
.cf-field textarea:focus {
  background: var(--color-white);
  border-color: var(--color-red);
  box-shadow: 0 0 0 3px rgba(227, 0, 27, 0.12);
}

.cf-field textarea {
  min-height: 140px;
}

.cf-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.cf-pill {
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-white);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-4);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.cf-pill:hover {
  border-color: var(--color-red);
  color: var(--color-red);
}

.cf-pill.is-active {
  background: var(--color-red);
  border-color: var(--color-red);
  color: var(--color-white);
}

.contact-form .btn {
  align-self: flex-start;
}

/* Two-step form: fields -> success confirmation. js/formspree.js watches
   the data-fs-success hook (populated by @formspree/ajax on submit, per
   its documented behavior) and toggles .is-submitted on the form. */
.cf-step--fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.cf-step--success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding-block: var(--space-6);
}

.contact-form.is-submitted .cf-step--fields {
  display: none;
}

.contact-form.is-submitted .cf-step--success {
  display: flex;
}

.cf-success-check {
  flex: none;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-apple-green);
  color: var(--color-white);
}

.cf-success-check svg {
  width: 26px;
  height: 26px;
}

.cf-success-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--color-text-primary);
}

.cf-success-text {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

/* @formspree/ajax's own success hook — used only as a silent signal (see
   js/formspree.js), never shown. Forced hidden via CSS rather than trusting
   the `hidden` attribute alone, since the library may clear it itself when
   populating the element with its default (English) "Thanks!" text. */
[data-fs-success] {
  display: none !important;
}

/* Formspree AJAX status (see js/formspree.js) — an error banner (success
   is handled separately via the .cf-step--success confirmation screen,
   not this banner) plus small inline text under whichever field failed
   validation. */
.fs-form-message {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.fs-form-message:empty {
  display: none;
}

.fs-form-message--error {
  background: rgba(227, 0, 27, 0.08);
  border: 1px solid rgba(227, 0, 27, 0.24);
  color: var(--color-red-dark);
}

.fs-field-error {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-red-dark);
}

.fs-field-error:empty {
  display: none;
}

.cf-field input[aria-invalid="true"],
.cf-field textarea[aria-invalid="true"] {
  border-color: var(--color-red);
}

.contact-form .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 640px) {
  .cf-row {
    grid-template-columns: 1fr;
  }

  .contact-form {
    padding: var(--space-6);
  }

  /* Same-specificity rule above (.contact-form) comes later in the
     cascade than .contact-form--bare's padding: 0, so on mobile it was
     silently winning and re-adding 32px of padding to forms nested in a
     modal — shrinking every field well below the modal's own content
     width. Re-assert bare stays padding-less at this breakpoint too. */
  .contact-form--bare {
    padding: 0;
  }

  .contact-form .btn {
    align-self: stretch;
  }
}
