/* ==========================================================================
   PavéPur — components.css
   Briques reutilisables : boutons, en-tete, cartes, formulaires, pied de page.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: 0.9rem 1.6rem;
  font-family: var(--f-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  white-space: nowrap;
  border-radius: var(--r-full);
  border: 1.5px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform var(--d) var(--e-out),
    box-shadow var(--d) var(--e-out),
    background-color var(--d) var(--e-out),
    color var(--d) var(--e-out),
    border-color var(--d) var(--e-out);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
  transition-duration: var(--d-fast);
}

/* Reflet qui balaie le bouton au survol. */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 80%
  );
  transform: translateX(-100%);
  transition: transform var(--d-slow) var(--e-out);
  pointer-events: none;
}

.btn:hover::after {
  transform: translateX(100%);
}

.btn__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform var(--d) var(--e-out);
}

.btn:hover .btn__icon {
  transform: translateX(3px);
}

.btn--primary {
  background: var(--c-cta);
  color: var(--c-white);
  box-shadow: var(--sh-accent);
}

.btn--primary:hover {
  background: var(--c-cta-hover);
  box-shadow: 0 14px 34px rgba(46, 155, 240, 0.36);
}

.btn--dark {
  background: var(--c-navy);
  color: var(--c-white);
  box-shadow: var(--sh);
}

.btn--dark:hover {
  background: var(--c-navy-600);
}

.btn--white {
  background: var(--c-white);
  color: var(--c-navy);
  box-shadow: var(--sh);
}

.btn--white:hover {
  background: var(--c-accent-050);
}

/* Contour clair, pense pour les fonds sombres / photos. */
.btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--c-white);
  border-color: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--c-white);
}

.btn--outline {
  background: transparent;
  color: var(--c-navy);
  border-color: var(--c-line);
}

.btn--outline:hover {
  border-color: var(--c-accent);
  color: var(--c-accent-700);
  background: var(--c-accent-050);
}

.btn--lg {
  padding: 1.1rem 2rem;
  font-size: 1.02rem;
}

.btn--block {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Toast (message flottant) — ex. « adresse copiée » du bouton Nous écrire
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 300;
  max-width: min(92vw, 460px);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0.85rem 1.15rem;
  background: var(--c-navy-900);
  color: var(--c-white);
  border-radius: var(--r);
  box-shadow: var(--sh-lg);
  font-size: var(--t-sm);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 16px);
  transition:
    opacity var(--d) var(--e-out),
    transform var(--d) var(--e-out),
    visibility var(--d);
}

.toast.is-shown {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--c-accent);
}

.toast strong {
  color: var(--c-white);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   En-tete / navigation
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Bandeau d'annonce
   -------------------------------------------------------------------------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 101; /* au-dessus de l'en-tete */
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: var(--s-4);
  background: linear-gradient(90deg, var(--c-navy) 0%, var(--c-navy-600) 100%);
  color: var(--c-white);
}

.topbar__inner {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
}

.topbar__inner svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--c-accent);
}

.topbar strong {
  font-weight: 700;
  color: var(--c-white);
}

.header {
  position: fixed;
  top: var(--bar-h);
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  /* Au chargement l'en-tete est pose sur la banniere : transparent. */
  background: transparent;
  transition:
    background-color var(--d) var(--e-out),
    box-shadow var(--d) var(--e-out),
    border-color var(--d) var(--e-out);
  border-bottom: 1px solid transparent;
}

/* Ajoute par main.js des que la page defile. */
.header.is-stuck {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--c-line);
  box-shadow: var(--sh-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

/* --- Logo --- */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  font-family: var(--f-display);
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c-white);
  transition: color var(--d) var(--e-out);
}

.header.is-stuck .logo {
  color: var(--c-navy);
}

.logo__mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.logo__accent {
  color: var(--c-accent);
}

/* --- Liens --- */

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-left: auto;
}

.nav__link {
  position: relative;
  padding: 0.55rem 0.9rem;
  font-size: 0.94rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  border-radius: var(--r-sm);
  transition: color var(--d) var(--e-out);
}

.header.is-stuck .nav__link {
  color: var(--c-ink);
}

/* Soulignement anime au survol / section active. */
.nav__link::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.32rem;
  height: 2px;
  border-radius: var(--r-full);
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--d) var(--e-out);
}

.nav__link:hover::after,
.nav__link.is-active::after {
  transform: scaleX(1);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--c-white);
}

.header.is-stuck .nav__link:hover,
.header.is-stuck .nav__link.is-active {
  color: var(--c-navy);
}

.header__cta {
  margin-left: var(--s-4);
  flex-shrink: 0;
}

/* --- Bouton hamburger --- */

.burger {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  flex-direction: column;
  gap: 5px;
}

.burger__bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-white);
  transition:
    transform var(--d) var(--e-out),
    opacity var(--d) var(--e-out),
    background-color var(--d) var(--e-out);
}

.header.is-stuck .burger__bar {
  background: var(--c-navy);
}

.burger[aria-expanded="true"] .burger__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger[aria-expanded="true"] .burger__bar:nth-child(2) {
  opacity: 0;
}

.burger[aria-expanded="true"] .burger__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Cartes
   -------------------------------------------------------------------------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.6rem, 1.2rem + 1vw, 2.2rem);
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  transition:
    transform var(--d) var(--e-out),
    box-shadow var(--d) var(--e-out),
    border-color var(--d) var(--e-out);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(46, 155, 240, 0.4);
  box-shadow: var(--sh-lg);
}

/* Le filet d'accent qui se revele en haut de la carte. */
.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 1.6rem;
  right: 1.6rem;
  height: 3px;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--c-accent), var(--c-navy-400));
  transform: scaleX(0);
  transition: transform var(--d) var(--e-out);
}

.card:hover::before {
  transform: scaleX(1);
}

.card__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: var(--s-5);
  border-radius: var(--r);
  background: var(--c-accent-050);
  color: var(--c-accent-700);
  transition:
    background-color var(--d) var(--e-out),
    color var(--d) var(--e-out),
    transform var(--d) var(--e-out);
}

.card:hover .card__icon {
  background: var(--c-cta);
  color: var(--c-white);
  transform: scale(1.06);
}

.card__icon svg {
  width: 26px;
  height: 26px;
}

.card__title {
  margin-bottom: var(--s-3);
}

.card__text {
  font-size: var(--t-sm);
  color: var(--c-muted);
  margin-bottom: var(--s-5);
  flex-grow: 1;
}

/* Lien « En savoir plus » : la fleche glisse au survol. */
.card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--f-display);
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--c-accent-700);
  align-self: flex-start;
}

.card__link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--d) var(--e-out);
}

.card:hover .card__link svg,
.card__link:hover svg {
  transform: translateX(4px);
}

/* Rend toute la carte cliquable sans imbriquer de liens (accessible : le lien
   reste le seul element focusable). */
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
}

/* --------------------------------------------------------------------------
   Pastilles de filtre
   -------------------------------------------------------------------------- */

.chip {
  padding: 0.55rem 1.15rem;
  font-family: var(--f-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-muted);
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-full);
  cursor: pointer;
  transition:
    color var(--d) var(--e-out),
    background-color var(--d) var(--e-out),
    border-color var(--d) var(--e-out),
    transform var(--d) var(--e-out);
}

.chip:hover {
  color: var(--c-navy);
  border-color: var(--c-navy-400);
  transform: translateY(-1px);
}

.chip[aria-pressed="true"] {
  color: var(--c-white);
  background: var(--c-navy);
  border-color: var(--c-navy);
}

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */

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

.field--full {
  grid-column: 1 / -1;
}

.field__label {
  font-family: var(--f-display);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--c-navy);
}

.field__req {
  color: var(--c-accent-700);
}

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  padding: 0.85rem 1.05rem;
  background: var(--c-white);
  border: 1.5px solid var(--c-line);
  border-radius: var(--r);
  font-size: 0.98rem;
  transition:
    border-color var(--d) var(--e-out),
    box-shadow var(--d) var(--e-out);
}

/* Assez clair pour se distinguer d'une valeur saisie, assez fonce pour rester
   lisible : 4,8:1 sur blanc. */
.field__input::placeholder,
.field__textarea::placeholder {
  color: #64738a;
}

.field__input:hover,
.field__select:hover,
.field__textarea:hover {
  border-color: var(--c-navy-400);
}

.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(46, 155, 240, 0.14);
}

.field__textarea {
  min-height: 130px;
  resize: vertical;
}

.field__select {
  appearance: none;
  /* Chevron dessine en CSS : aucune requete supplementaire. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6b80' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 18px;
  padding-right: 2.8rem;
  cursor: pointer;
}

/* Etat d'erreur : signale par la couleur ET par le texte (jamais la couleur
   seule — cf. accessibilite). */
.field__input[aria-invalid="true"],
.field__select[aria-invalid="true"],
.field__textarea[aria-invalid="true"] {
  border-color: var(--c-error);
  background: #fdf5f5;
}

.field__error {
  display: none;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--c-error);
}

.field__error.is-shown {
  display: flex;
}

/* Champ piege a robots : invisible pour l'humain, rempli par les bots. */
.field--honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* --- Depot de photos --- */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-6) var(--s-5);
  text-align: center;
  background: var(--c-paper);
  border: 2px dashed var(--c-line);
  border-radius: var(--r);
  cursor: pointer;
  transition:
    border-color var(--d) var(--e-out),
    background-color var(--d) var(--e-out);
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--c-accent);
  background: var(--c-accent-050);
}

.dropzone svg {
  width: 30px;
  height: 30px;
  color: var(--c-accent);
}

.dropzone__title {
  font-family: var(--f-display);
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--c-navy);
}

.dropzone__hint {
  font-size: var(--t-xs);
  color: var(--c-muted);
}

.previews {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-4);
}

.previews:empty {
  margin-top: 0;
}

.preview {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--c-line);
}

.preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview__remove {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-full);
  background: rgba(10, 18, 32, 0.72);
  color: var(--c-white);
  font-size: 14px;
  line-height: 1;
  transition: background-color var(--d) var(--e-out);
}

.preview__remove:hover {
  background: var(--c-error);
}

/* --- Retour apres envoi --- */

.form__status {
  display: none;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r);
  font-size: var(--t-sm);
}

.form__status.is-shown {
  display: flex;
}

.form__status--ok {
  background: #eaf7f2;
  color: #0c6146;
  border: 1px solid #b9e3d4;
}

.form__status--err {
  background: #fdf0f1;
  color: #93202c;
  border: 1px solid #f2c9ce;
}

.form__status svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Etat « envoi en cours » du bouton. */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn.is-loading .btn__icon {
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */

.footer {
  background: var(--c-navy-900);
  color: var(--c-muted-dark);
  padding-block: clamp(3.5rem, 2.5rem + 4vw, 5.5rem) var(--s-6);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: clamp(2rem, 1rem + 3vw, 4rem);
}

.footer .logo {
  color: var(--c-white);
  margin-bottom: var(--s-4);
}

.footer__about {
  font-size: var(--t-sm);
  max-width: 34ch;
}

.footer__title {
  font-family: var(--f-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-white);
  margin-bottom: var(--s-5);
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  font-size: var(--t-sm);
}

.footer__list a {
  transition: color var(--d) var(--e-out);
}

.footer__list a:hover {
  color: var(--c-accent);
}

.footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
}

.footer__contact-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 4px;
  color: var(--c-accent);
}

.socials {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-5);
}

.socials a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.07);
  color: var(--c-white);
  transition:
    background-color var(--d) var(--e-out),
    transform var(--d) var(--e-out);
}

.socials a:hover {
  background: var(--c-cta);
  transform: translateY(-2px);
}

.socials svg {
  width: 18px;
  height: 18px;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
  padding-top: var(--s-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: var(--t-xs);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
}

.footer__legal a:hover {
  color: var(--c-accent);
}

/* --------------------------------------------------------------------------
   Adaptations mobiles
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .burger {
    display: flex;
  }

  /* Panneau plein ecran : cible tactile large, pas de defilement horizontal.
     Il commence sous le bandeau + l'en-tete. */
  .nav {
    position: fixed;
    inset: calc(var(--bar-h) + var(--header-h)) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: var(--s-4) clamp(1.25rem, 4vw, 2.5rem) var(--s-7);
    background: var(--c-white);
    border-bottom: 1px solid var(--c-line);
    box-shadow: var(--sh-lg);

    /* Ferme : replie et retire du parcours de tabulation. */
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition:
      transform var(--d) var(--e-out),
      opacity var(--d) var(--e-out),
      visibility var(--d);
  }

  .nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  /* Le panneau est blanc : les etats clairs prevus pour la banniere sombre
     doivent TOUS etre neutralises, sinon le lien actif s'affiche en blanc sur
     blanc — donc invisible. D'ou la liste explicite (meme specificite que les
     regles de bureau qu'elle remplace). */
  .nav__link,
  .header.is-stuck .nav__link,
  .nav__link:hover,
  .header.is-stuck .nav__link:hover {
    padding: 0.95rem 0.25rem;
    font-size: 1.05rem;
    color: var(--c-ink);
    border-bottom: 1px solid var(--c-line);
    border-radius: 0;
  }

  /* La section en cours reste signalee — en bleu, pas en blanc. */
  .nav__link.is-active,
  .header.is-stuck .nav__link.is-active {
    color: var(--c-accent-700);
    font-weight: 600;
  }

  .nav__link::after {
    display: none;
  }

  .header__cta {
    margin: var(--s-5) 0 0;
  }

  .header__cta .btn {
    width: 100%;
  }
}

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

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
