/* =========================
   MODAL AUTH (c-modal)
   ========================= */

.c-modal[aria-hidden="true"] { display: none; }
.c-modal[aria-hidden="false"] { display: block; }

.c-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.c-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}

.c-modal__dialog{
  position: relative;
  width: min(560px, calc(100vw - 32px));
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 16px;
  padding: 22px 20px 18px;
}

.c-modal__close{
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
}

.c-modal__head{ padding-right: 46px; }
.c-modal__title{
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  color: #0f172a;
}
.c-modal__sub{
  margin: 6px 0 0;
  color: rgba(15,23,42,.72);
  font-size: .95rem;
}

.c-modal__alert{
  display: none;
  margin: 14px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: .95rem;
  border: 1px solid transparent;
}
.c-modal__alert.is-error{
  display:block;
  color:#7f1d1d;
  background:#fef2f2;
  border-color:#fecaca;
}
.c-modal__alert.is-success{
  display:block;
  color:#14532d;
  background:#f0fdf4;
  border-color:#bbf7d0;
}

.c-form{ margin-top: 10px; }

.c-field{ display:block; margin: 12px 0; }
.c-field__label{
  display:block;
  font-size: .9rem;
  color: rgba(15,23,42,.75);
  margin: 0 0 6px;
}
.c-field__input{
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.16);
  padding: 0 12px;
  font-size: 1rem;
}
.c-field__input:focus{
  outline: 1px solid rgba(59,130,246,.35);
  outline-offset: 2px;
  border-color: rgba(59,130,246,.5);
}

.c-btn{
  border: 1px solid transparent;
  border-radius: 12px;
  height: 44px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
}
.c-btn--block{ width: 100%; }

.c-btn--primary:disabled{
  opacity: .6;
  cursor: not-allowed;
}

.c-form__links{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.c-linkbtn{
  border: 0;
  background: transparent;
  padding: 6px 0;
  cursor: pointer;
  font-weight: 600;
}
.c-linkbtn--muted{ color: rgba(15,23,42,.65); font-weight: 600; }

.c-fieldset{
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0;
}
.c-fieldset__legend{
  font-weight: 700;
  color: #0f172a;
  padding: 0 6px;
}

.c-radio{
  display:flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
}
.c-radio:hover{ background: rgba(15,23,42,.04); }
.c-radio input{ margin-top: 3px; }

/* lock scroll */
html.is-lock, body.is-lock{ overflow: hidden; }


/* =========================================
   AUTH MODAL — VISUEL PREMIUM (drop-in)
   Ajoute: blur, animations, micro-interactions
   ========================================= */

/* Backdrop + blur */
.c-modal__backdrop{
  background: rgba(2, 6, 23, .55);        /* sombre élégant */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Animation d'entrée/sortie (pilotée par aria-hidden) */
.c-modal[aria-hidden="false"] .c-modal__dialog{
  animation: authIn .22s ease-out both;
}
.c-modal[aria-hidden="true"] .c-modal__dialog{
  animation: authOut .16s ease-in both;
}

/* Dialog “glass + card” */
.c-modal__dialog{
  background: rgba(255,255,255,.92);
}

/* Titre plus “premium” */
.c-modal__title{
  letter-spacing: -0.01em;
}
.c-modal__sub{
  margin-top: 8px;
  line-height: 1.35;
}

/* Champs: plus doux + focus ring */
.c-field__input{
  background: rgba(255,255,255,.8);
  border-color: rgba(15,23,42,.14);
  transition: box-shadow .15s ease, border-color .15s ease, transform .12s ease;
}
.c-field__input:focus{
  box-shadow: 0 0 0 4px rgba(37,99,235,.18);
  transform: translateY(-1px);
}

/* Bouton primaire: hover + press */
.c-btn--primary:hover{
  filter: brightness(1.03);
}
.c-btn--primary:active{
  transform: translateY(1px);
  box-shadow: 0 10px 20px rgba(37,99,235,.18);
}


/* Alert: animation douce */
.c-modal__alert.is-error,
.c-modal__alert.is-success{
  animation: authShakeIn .18s ease-out both;
}

/* Links */
.c-linkbtn{
  opacity: .95;
  transition: opacity .12s ease, transform .12s ease;
}
.c-linkbtn:hover{
  opacity: 1;
  transform: translateY(-1px);
}

/* Loader inline dans le bouton (si .is-loading) */
.c-btn.is-loading{
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.c-btn.is-loading::after{
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.55);
  border-top-color: rgba(255,255,255,1);
  animation: authSpin .8s linear infinite;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .c-modal[aria-hidden="false"] .c-modal__dialog,
  .c-modal[aria-hidden="true"] .c-modal__dialog,
  .c-modal__alert.is-error,
  .c-modal__alert.is-success{
    animation: none !important;
  }
  .c-field__input,
  .c-btn--primary,
  .c-linkbtn,
  .c-modal__close{
    transition: none !important;
  }
}

/* Keyframes */
@keyframes authIn{
  from{ transform: translateY(14px) scale(.985); opacity: 0; }
  to  { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes authOut{
  from{ transform: translateY(0) scale(1); opacity: 1; }
  to  { transform: translateY(10px) scale(.99); opacity: 0; }
}
@keyframes authSpin{
  to{ transform: rotate(360deg); }
}
@keyframes authShakeIn{
  0%{ transform: translateY(-2px); opacity: 0; }
  100%{ transform: translateY(0); opacity: 1; }
}

