/* Vérification du code e-mail (js/otp.js) : cases, danse des losanges, anneau, accès autorisé.
   Couleurs : bleu du diamant + violet, comme l'animation de référence. */
.otpx { --otp-a: #60a5fa; --otp-b: #8b5cf6; --otp-ok: #22c55e; text-align: center; }
.otpx__panel { display: grid; justify-items: center; gap: .55rem; animation: otpIn .5s cubic-bezier(.16, 1, .3, 1); }
.otpx__panel[hidden] { display: none; }
.otpx__panel h2 { margin: .2rem 0 0; }
.otpx__panel p { color: var(--muted); margin: 0; }
.otpx__icon { font-size: 2.2rem; filter: drop-shadow(0 0 16px rgba(96, 165, 250, .45)); animation: float 4s ease-in-out infinite; }
@keyframes otpIn { from { opacity: 0; transform: translateY(14px) scale(.97); filter: blur(4px); } }

/* Les 6 cases */
.otpx__boxes { display: flex; justify-content: center; gap: clamp(.35rem, 1.6vw, .55rem); margin: 1rem auto .4rem; max-width: 100%; }
/* « .otpx .form » : plus prioritaire que le style général des champs (largeur 100 %) */
.otpx .otpx__box, .form .otpx__box {
  flex: 0 0 auto; width: clamp(38px, 11vw, 50px); min-width: 0; height: clamp(46px, 13vw, 58px); padding: 0; text-align: center;
  font: 700 clamp(1.2rem, 5vw, 1.55rem) / 1 "Sora", "Inter", sans-serif; color: #fff; caret-color: var(--otp-a);
  background: rgba(10, 12, 20, .7); border: 1.5px solid rgba(148, 163, 184, .25); border-radius: 12px;
  transition: border-color .2s, box-shadow .25s, transform .2s, background .2s;
}
.otpx .otpx__box:focus, .form .otpx__box:focus { outline: none; border-color: var(--otp-a); box-shadow: 0 0 0 3px rgba(96, 165, 250, .18), 0 0 22px rgba(139, 92, 246, .45); transform: translateY(-2px); }
.otpx .otpx__box.is-filled { border-color: rgba(139, 92, 246, .75); background: rgba(30, 27, 60, .75); animation: otpPop .25s ease-out; }
@keyframes otpPop { 50% { transform: scale(1.12); } }
.otpx__boxes.is-error .otpx__box { border-color: #f87171; box-shadow: 0 0 18px rgba(248, 113, 113, .45); }
.otpx__boxes.is-error { animation: otpShake .5s; }
@keyframes otpShake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* Anneau « Vérification… » */
.otpx__ring { position: relative; width: 96px; height: 96px; margin: 1rem 0 .4rem; }
.otpx__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.otpx__ring circle { fill: none; stroke-width: 6; }
.otpx__track { stroke: rgba(148, 163, 184, .15); }
.otpx__bar { stroke: url(#otpGrad); stroke: var(--otp-b); stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(139, 92, 246, .7)); transition: stroke .3s; }
.otpx__pct { position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.2rem "Sora", sans-serif; color: #c4b5fd; }
.otpx[data-step="verify"] .otpx__ring { animation: otpGlow 1.4s ease-in-out infinite; }
@keyframes otpGlow { 50% { filter: drop-shadow(0 0 18px rgba(96, 165, 250, .45)); } }

/* « Accès autorisé » */
.otpx__check { position: relative; width: 84px; height: 84px; margin: 1rem 0 .3rem; }
.otpx__check svg { overflow: visible; background: none; width: 100%; height: 100%; position: relative; z-index: 1; animation: otpCheckIn .55s cubic-bezier(.2, 1.6, .4, 1) both; }
.otpx__check circle { fill: var(--otp-ok); filter: drop-shadow(0 0 18px rgba(34, 197, 94, .6)); }
.otpx__check path { fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: otpTick .45s .3s ease-out forwards; }
@keyframes otpCheckIn { from { transform: scale(0) rotate(-45deg); } }
@keyframes otpTick { to { stroke-dashoffset: 0; } }
.otpx__burst i {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%;
  background: hsl(calc(140 + var(--t) * 40) 85% 65%); opacity: 0;
  animation: otpBurst .9s .15s cubic-bezier(.16, 1, .3, 1) forwards;
}
@keyframes otpBurst {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(.3); }
}
.otpx__badge {
  display: inline-block; padding: .25rem .8rem; border-radius: 999px; font: 800 .72rem/1.4 "Inter", sans-serif; letter-spacing: .14em;
  color: #052e16; background: linear-gradient(135deg, #86efac, #22c55e); box-shadow: 0 0 20px rgba(34, 197, 94, .45);
  animation: otpIn .5s .55s cubic-bezier(.16, 1, .3, 1) both;
}

/* Règles du mot de passe qui se cochent pendant la saisie */
.pw-rules { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin: -.2rem 0 .2rem; padding: 0; font-size: .82rem; color: var(--muted); text-align: left; }
.pw-rules li { display: inline-flex; align-items: center; gap: .35rem; transition: color .25s; }
.pw-rules li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(148, 163, 184, .5); transition: background .25s, border-color .25s, transform .25s; }
.pw-rules li.is-ok { color: #86efac; }
.pw-rules li.is-ok::before { background: #22c55e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; border-color: #22c55e; transform: scale(1.1); }

/* Page « nouveau mot de passe » : les cases au-dessus des champs */
#resetForm .otpx__boxes { margin-top: .2rem; }

@media (prefers-reduced-motion: reduce) {
  .otpx__panel, .otpx__icon, .otpx__box.is-filled, .otpx__boxes.is-error, .otpx__check svg, .otpx__check path, .otpx__burst i, .otpx__badge, .otpx__ring { animation: none !important; }
  .otpx__check path { stroke-dashoffset: 0; }
}
