/* main.css — Base, layout global, entêtes, page 1, bouton d'envoi */

/* ========== RESET / BASE ========== */
*,
*::before,
*::after{
  box-sizing:border-box;
}

:root{
  /* Big Caslon : police système. Si elle n'existe pas sur l'appareil, fallback serif. */
  --font-bandeau:"Big Caslon","Libre Caslon Text","Baskerville","Times New Roman",serif;
  --font-contenu:"Times New Roman",Times,serif;

  --gris-ruban:#b5b5b5;
  --gris-bouton:#e5e5e5;
  --gris-bouton-hover:#b5b5b5;
  --border:#000;
  --field-border:#b3b3b3;

  --radio-offset:3px;
}

body{
  margin:0;
  font-family:var(--font-contenu);
  line-height:1.5;
  background:#d7dbe7;
  color:#222;
}

a{
  color:#1846a3;
  text-decoration:none;
}
a:hover{ text-decoration:underline; }

button,
input,
textarea,
select{
  font-family:inherit;
}

input[type="checkbox"],
input[type="radio"]{
  accent-color:#000;
  width:16px;
  height:16px;
  cursor:pointer;
}

input[type="radio"]{
  transform:translateY(var(--radio-offset));
}

input[type="text"],
input[type="date"],
input[type="tel"],
input[type="email"]{
  border:1px solid var(--field-border);
}

textarea{
  border:1px solid var(--field-border);
  font:inherit;
}

input::placeholder,
textarea::placeholder{
  opacity:.4;
}
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder{
  opacity:.4;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
textarea:focus{
  outline:none;
  border-color:#000;
}

.disabled-field{
  pointer-events:none;
}

/* ========== LAYOUT GLOBAL ========== */
.dossier-wrapper{
  padding:24px 8px 16px;
  display:flex;
  justify-content:center;
}

.dossier-form{
  width:100%;
  max-width:960px;
  display:flex;
  flex-direction:column;
  gap:32px;
}

.fiche-page{
  background:#fff;
  border-radius:4px;
  box-shadow:0 8px 18px rgba(0,0,0,.12);
  padding:32px 40px 20px;
  position:relative;
  font-size:14px;
  font-family:var(--font-contenu);
}

.form-section{
  margin-bottom:24px;
}

.ruban-titre{
  background:var(--gris-ruban);
  border:1px solid var(--border);
  padding:6px 10px;
  margin-bottom:12px;
  text-align:center;
}

.ruban-titre h2{
  margin:0;
  font-size:1rem;
  text-transform:uppercase;
  font-family:var(--font-bandeau);
}

/* ========== ENTÊTES ========== */
.ligne-entete{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:24px;
}

.logo-block{
  display:flex;
  align-items:center;
  gap:10px;
}

.logo{
  width:64px;
  height:64px;
  object-fit:contain;
}

.logo-text{
  font-size:.78rem;
}

.header-meta{
  font-size:.9rem;
  text-align:right;
  margin-top:21px;
}

.date-depot{
  margin-left:8px;
  padding:2px 4px;
  font-size:.85rem;
  width:100px;
  text-align:center;
}

.date-depot::-webkit-calendar-picker-indicator,
.date-depot::-webkit-inner-spin-button,
.date-depot::-webkit-clear-button{
  display:none;
}

.date-depot.no-edit-date{
  pointer-events:none;
}

/* ========== PAGE 1 ========== */
.titre-feuille{
  border:2px solid #000;
  padding:10px 12px;
  text-align:center;
  margin:32px 0 24px;
}

.titre-feuille h1{
  margin:0;
  font-size:1.1rem;
  text-transform:uppercase;
  letter-spacing:.04em;
  font-family:var(--font-bandeau);
}

.encart-rgpd{
  border:1px solid #000;
  padding:14px 16px;
  font-size:.88rem;
  margin-bottom:24px;
  background:#f7f7f7;
  font-family:var(--font-contenu);
}

.bloc-texte p{
  margin:0 0 10px;
}

.liste-contact{
  margin:0 0 18px 0;
  padding-left:18px;
}

.gros-picto{
  text-align:center;
  margin:24px 0 8px;
}

.picto-phone{
  font-size:3rem;
}

/* ========== PIED DE PAGE ========== */
.fiche-footer{
  border-top:1px solid #bbb;
  margin-top:8px;
  padding-top:6px;
  font-size:.75rem;
  text-align:center;
  font-family:var(--font-contenu);
}

/* ========== BOUTON ENVOYER ========== */
.form-actions-global{
  display:flex;
  justify-content:center;
  width:100%;
  margin-top:8px;
}

.form-actions-global .mp-ebp__btn{
  all:unset;
  display:inline-block;
  box-sizing:border-box;
  cursor:pointer;
  position:relative;
  isolation:isolate;
  overflow:hidden;

  --scale:1;
  --hover-scale:1.24;

  padding:18px 34px;
  border-radius:9999px;
  font-family:'Merriweather',serif;
  font-weight:900;
  font-size:1.45rem;
  line-height:1.1;
  text-transform:uppercase;
  color:#0e1030;
  text-decoration:none;

  background:
    radial-gradient(160% 200% at 50% 40%,
      #C6C9FF 0%,
      #9EA8FF 38%,
      #6F79B7 68%,
      #2E2C62 100%);
  background-color:#2E2C62;

  box-shadow:
    0 0 0 1px rgba(230,231,255,.28),
    0 12px 26px rgba(198,201,255,.40),
    0 2px 6px rgba(0,0,0,.12),
    0 0 0 2px rgba(198,201,255,.95),
    0 18px 46px rgba(158,168,255,.65),
    0 6px 16px rgba(0,0,0,.2) !important;

  transform:scale(var(--scale));
  will-change:transform,box-shadow;
  transition:transform .35s cubic-bezier(.2,.7,.3,1),box-shadow .35s ease;
}

.form-actions-global .mp-ebp__btn:hover{
  --scale:var(--hover-scale);
  box-shadow:
    0 0 0 1px rgba(230,231,255,.36),
    0 16px 40px rgba(198,201,255,.55),
    0 4px 10px rgba(0,0,0,.14),
    0 0 0 3px rgba(198,201,255,1),
    0 26px 60px rgba(158,168,255,.78),
    0 10px 22px rgba(0,0,0,.24) !important;
}

.form-actions-global .mp-ebp__btn:focus{ outline:none; }
.form-actions-global .mp-ebp__btn:focus-visible{
  box-shadow:
    0 0 0 4px rgba(255,255,255,1),
    0 0 0 8px rgba(158,168,255,.85),
    0 26px 60px rgba(158,168,255,.78),
    0 10px 22px rgba(0,0,0,.24) !important;
  transition:box-shadow .2s ease;
}

.form-actions-global .mp-ebp__arrow{
  position:absolute;
  top:50%;
  left:0%;
  width:26px;
  height:26px;
  transform:translate(-140%,-50%);
  color:currentColor;
  opacity:0;
  pointer-events:none;
}
.form-actions-global .mp-ebp__btn:hover .mp-ebp__arrow{
  animation:mp-ebp-arrow 800ms cubic-bezier(.18,.66,.26,.99) forwards;
}

.form-actions-global .mp-ebp__btn::before,
.form-actions-global .mp-ebp__btn::after{
  content:"";
  position:absolute;
  top:50%;
  width:10px;
  height:10px;
  border-radius:50%;
  transform:translate(-50%,-50%) scale(.25);
  opacity:0;
  pointer-events:none;
  box-shadow:
    inset 0 0 6px rgba(0,0,0,.45),
    0 0 10px rgba(198,201,255,.55);
  background:radial-gradient(circle at 50% 50%,rgba(0,0,0,.55) 0%,rgba(0,0,0,.25) 70%,rgba(0,0,0,0) 100%);
}
.form-actions-global .mp-ebp__btn::before{ left:0%; }
.form-actions-global .mp-ebp__btn::after{ left:100%; }
.form-actions-global .mp-ebp__btn:hover::before{ animation:mp-ebp-hole-in 800ms ease-out forwards; }
.form-actions-global .mp-ebp__btn:hover::after{ animation:mp-ebp-hole-out 800ms ease-out forwards; }

.form-actions-global .mp-ebp__spark{
  --dx:0px;
  --dy:0px;
  --t:0ms;
  position:absolute;
  top:50%;
  left:100%;
  width:6px;
  height:6px;
  border-radius:50%;
  background:#fff;
  filter:blur(.2px);
  transform:translate(-50%,-50%) scale(0);
  opacity:0;
  pointer-events:none;
  box-shadow:0 0 6px rgba(255,255,255,.9),0 0 12px rgba(198,201,255,.7);
}
.form-actions-global .mp-ebp__btn:hover .mp-ebp__spark{ animation:mp-ebp-spark 700ms ease-out forwards; }
.form-actions-global .mp-ebp__spark.s1{ --dx:28px; --dy:-14px; --t:40ms; }
.form-actions-global .mp-ebp__spark.s2{ --dx:18px; --dy:12px; --t:60ms; }
.form-actions-global .mp-ebp__spark.s3{ --dx:36px; --dy:6px; --t:80ms; }

.form-actions-global .mp-ebp__label{
  position:relative;
  display:inline-block;
}
.form-actions-global .mp-ebp__label::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-8px;
  width:90%;
  height:3px;
  background:#fff;
  border-radius:2px;
  box-shadow:0 0 6px rgba(255,255,255,.95),0 0 14px rgba(255,255,255,.75),0 0 28px rgba(255,255,255,.45);
  transform:translateX(-130%);
  opacity:0;
  pointer-events:none;
}
.form-actions-global .mp-ebp__btn:hover .mp-ebp__label::after{
  opacity:1;
  animation:mp-ebp-underline 900ms cubic-bezier(.2,.7,.3,1) forwards 120ms;
}

@keyframes mp-ebp-arrow{
  0%{ opacity:0; transform:translate(-140%,-50%) rotate(0); }
  15%{ opacity:1; }
  50%{ transform:translate(0%,-50%) rotate(0); }
  100%{ opacity:0; transform:translate(140%,-50%) rotate(0); }
}
@keyframes mp-ebp-hole-in{
  0%{ opacity:0; transform:translate(-50%,-50%) scale(.2); left:0%; }
  25%{ opacity:1; transform:translate(-50%,-50%) scale(1); left:8%; }
  60%{ opacity:1; transform:translate(-50%,-50%) scale(.92); left:16%; }
  100%{ opacity:0; transform:translate(-50%,-50%) scale(.6); left:24%; }
}
@keyframes mp-ebp-hole-out{
  0%{ opacity:0; transform:translate(-50%,-50%) scale(.2); left:76%; }
  40%{ opacity:1; transform:translate(-50%,-50%) scale(1); left:88%; }
  80%{ opacity:1; transform:translate(-50%,-50%) scale(.92); left:96%; }
  100%{ opacity:0; transform:translate(-50%,-50%) scale(.6); left:100%; }
}
@keyframes mp-ebp-spark{
  0%{ opacity:0; transform:translate(-50%,-50%) scale(.4); }
  20%{ opacity:1; transform:translate(calc(-50% + 4px),calc(-50%)) scale(.8); }
  100%{ opacity:0; transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(.2); }
}
@keyframes mp-ebp-underline{
  0%{ transform:translateX(-130%); }
  100%{ transform:translateX(130%); }
}

@media (prefers-reduced-motion:reduce){
  .form-actions-global .mp-ebp__btn,
  .form-actions-global .mp-ebp__btn:hover{
    transform:none;
  }
  .form-actions-global .mp-ebp__arrow,
  .form-actions-global .mp-ebp__spark,
  .form-actions-global .mp-ebp__btn::before,
  .form-actions-global .mp-ebp__btn::after,
  .form-actions-global .mp-ebp__label::after{
    animation:none !important;
    opacity:1;
    transform:none;
  }
}

/* ========== RESPONSIVE GLOBAL ========== */
@media (max-width:768px){
  .fiche-page{
    padding:20px 16px;
  }

  .ligne-entete{
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
  }

  .header-meta{
    text-align:left;
  }
}

/* ==========================================================
   Bouton d'envoi — version sobre assortie au formulaire papier
   ========================================================== */
.form-actions-global{
  display:flex;
  justify-content:center;
  width:100%;
  margin:14px 0 6px;
}

.form-actions-global .mp-ebp__btn{
  all:unset;
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:260px;
  padding:12px 28px;
  border:2px solid #000;
  border-radius:4px;
  background:#000;
  color:#fff;
  cursor:pointer;
  font-family:var(--font-bandeau);
  font-size:1.05rem;
  font-weight:800;
  line-height:1.15;
  letter-spacing:.08em;
  text-transform:uppercase;
  text-align:center;
  box-shadow:none !important;
  transform:none !important;
  transition:background-color .16s ease, color .16s ease, transform .16s ease;
}

.form-actions-global .mp-ebp__btn:hover{
  background:#fff;
  color:#000;
  transform:translateY(-1px) !important;
  box-shadow:none !important;
}

.form-actions-global .mp-ebp__btn:focus,
.form-actions-global .mp-ebp__btn:focus-visible{
  outline:2px solid #000;
  outline-offset:4px;
  box-shadow:none !important;
}

.form-actions-global .mp-ebp__label{
  position:static;
  display:inline-block;
}

.form-actions-global .mp-ebp__label::after,
.form-actions-global .mp-ebp__btn::before,
.form-actions-global .mp-ebp__btn::after,
.form-actions-global .mp-ebp__arrow,
.form-actions-global .mp-ebp__spark{
  display:none !important;
  content:none !important;
  animation:none !important;
}

@media (max-width:650px){
  .form-actions-global .mp-ebp__btn{
    width:100%;
    min-width:0;
    padding:11px 18px;
    font-size:.98rem;
  }
}

/* ========== PAGE 1 — TITRE SEUL SUR LE FOND ========== */
.page-1{
  background:transparent;
  box-shadow:none;
  border-radius:0;
  padding:18px 0 4px;
}

.page-1 .titre-feuille{
  border:0;
  padding:0;
  margin:0;
  text-align:center;
}

.page-1 .titre-feuille h1{
  display:block;
  margin:0;
  padding:0;
  font-size:1.55rem;
  line-height:1.2;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-family:var(--font-bandeau);
  font-weight:700;
}

@media (max-width:768px){
  .page-1{
    padding:10px 6px 0;
  }

  .page-1 .titre-feuille h1{
    font-size:1.18rem;
    letter-spacing:.055em;
  }
}


/* =========================================================
   Barre noire de progression + état du formulaire en haut
========================================================= */

.form-progress{
  position:sticky;
  top:0;
  z-index:1800;
  width:100%;
  min-height:30px;
  padding:5px 8px 6px;
  background:linear-gradient(180deg, rgba(215,219,231,.96) 0%, rgba(215,219,231,.78) 100%);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

.form-progress__inner{
  width:100%;
  max-width:960px;
  margin:0 auto;
}

.form-progress__status{
  display:block;
  margin:0 0 4px;
  font-family:var(--font-contenu);
  font-size:.75rem;
  line-height:1;
  font-weight:700;
  letter-spacing:.035em;
  text-align:center;
  color:rgba(31,31,31,.74);
  text-transform:uppercase;
  transition:color .18s ease, opacity .18s ease;
}

.form-progress__status.is-complete{
  color:#2e7d32;
}

.form-progress__status.is-error{
  color:#c00000;
}

.form-progress__bar{
  display:block;
  width:100%;
  height:3px;
  border-radius:999px;
  background:rgba(0,0,0,.12);
  overflow:hidden;
}

.form-progress__bar-fill{
  display:block;
  width:var(--form-progress, 0%);
  height:100%;
  border-radius:inherit;
  background:#1f1f1f;
  transition:width .22s ease;
}

/* =========================================================
   État d'envoi du bouton
========================================================= */

.form-actions-global .mp-ebp__btn.is-submitting{
  cursor:wait;
  pointer-events:none;
  animation:submitPulse 1s ease-in-out infinite alternate;
}

.form-actions-global .mp-ebp__btn.is-submitting::before{
  content:"";
  position:absolute;
  left:18px;
  top:50%;
  width:18px;
  height:18px;
  margin-top:-9px;
  border-radius:999px;
  border:2px solid rgba(14,16,48,.28);
  border-top-color:#0e1030;
  animation:submitSpin .75s linear infinite;
  z-index:2;
}

.form-actions-global .mp-ebp__btn.is-submitting .mp-ebp__label{
  padding-left:18px;
}

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

@keyframes submitPulse{
  from{ filter:saturate(1); }
  to{ filter:saturate(1.12) brightness(1.04); }
}

/* =========================================================
   Carte de confirmation après envoi
========================================================= */

.form-message.is-success.form-message--card{
  max-width:760px;
  padding:0;
  border:0;
  color:#222;
  background:transparent;
  box-shadow:none;
}

.form-success-card{
  border:1px solid rgba(46,125,50,.55);
  border-radius:18px;
  background:
    radial-gradient(420px 180px at 50% -20%, rgba(46,125,50,.10), transparent 72%),
    #fff;
  box-shadow:0 16px 36px rgba(0,0,0,.12);
  padding:22px 24px;
  text-align:center;
  animation:successCardIn .45s cubic-bezier(.2,.8,.2,1) both;
}

.form-success-card__icon{
  width:38px;
  height:38px;
  margin:0 auto 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#2e7d32;
  color:#fff;
  font-family:Arial, sans-serif;
  font-size:1.25rem;
  font-weight:800;
}

.form-success-card__title{
  margin:0 0 8px;
  font-family:var(--font-bandeau);
  font-size:1.12rem;
  letter-spacing:.055em;
  text-transform:uppercase;
  color:#1f1f1f;
}

.form-success-card__text{
  margin:0;
  font-size:.98rem;
  line-height:1.45;
  color:#222;
}


@keyframes successCardIn{
  0%{
    opacity:0;
    transform:translateY(12px) scale(.98);
    filter:blur(3px);
  }

  100%{
    opacity:1;
    transform:translateY(0) scale(1);
    filter:blur(0);
  }
}

@media (max-width:640px){
  .form-progress{
    height:12px;
    padding:0 6px;
  }

  .form-progress__bar{
    top:5px;
  }

  .form-success-card{
    padding:20px 16px;
  }
}

@media (prefers-reduced-motion:reduce){
  .form-progress__bar-fill,
  .form-actions-global .mp-ebp__btn.is-submitting,
  .form-actions-global .mp-ebp__btn.is-submitting::before,
  .form-success-card{
    animation:none !important;
    transition:none !important;
  }
}
