/* =====================================================================
   POINT OF VIEW — Forgot-password card (3 pages: email · verify · new password)
   ---------------------------------------------------------------------
   Markup: resources/views/components/forgot-card.blade.php + auth/forgot-*.blade.php,
           auth/reset-password.blade.php, components/reset-steps.blade.php
   Builds on pov.css tokens + pov-auth-shell.css (page grid, quote, floating fields).
   Same card surface as the Log in / Sign up faces (pov-auth-flip.css).
   Behaviour: public/js/pov-auth-forgot.js
   ===================================================================== */

/* ---------- Card ---------- */
.pov-forgot {
  width: 100%;
  max-width: 460px;
  justify-self: end;
  min-width: 0;
  padding: clamp(1.25rem, 3.6vw, 1.85rem);
  border: 1px solid var(--pov-border-strong);
  border-radius: var(--pov-r-xl);
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(255, 107, 53, 0.09), transparent 60%),
    var(--face-bg);
  box-shadow: var(--pov-shadow-lg), 0 0 0 1px rgba(255, 107, 53, 0.06);
  animation: pov-forgot-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* Slide in from the right only where there is room for the 26px (≥1280px). On narrower
   screens a sideways start would overflow the viewport for a moment, and mobile browsers
   then widen the page (horizontal scroll), so the card fades up instead. */
@keyframes pov-forgot-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes pov-forgot-in-side { from { opacity: 0; transform: translateX(26px); } }
@media (min-width: 1280px) {
  .pov-forgot { animation-name: pov-forgot-in-side; }
}
@media (max-width: 899.98px) {
  .pov-forgot { justify-self: center; }
}

/* ---------- Top row: back link + 3-step progress ---------- */
.pov-forgot__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}
.pov-forgot__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--pov-text-muted);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}
.pov-forgot__back:hover { color: #fff; }
.pov-forgot__back:focus-visible { outline: 2px solid var(--pov-accent); outline-offset: 3px; border-radius: 4px; }

.pov-reset-steps {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pov-reset-steps__step {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--pov-border-strong);
  border-radius: 50%;
  color: var(--pov-text-dim);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.35s, border-color 0.35s, color 0.35s, box-shadow 0.35s;
}
.pov-reset-steps__step + .pov-reset-steps__step { margin-left: 32px; } /* 6px + 20px bar + 6px */
.pov-reset-steps__step + .pov-reset-steps__step::before { /* the bar leading to this step */
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% + 6px);
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--pov-border-strong);
  transform: translateY(-50%);
}
.pov-reset-steps__step.is-current {
  border-color: var(--pov-accent);
  background: rgba(255, 107, 53, 0.18);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.12);
}
.pov-reset-steps__step.is-done {
  border-color: transparent;
  background: var(--pov-gradient);
  color: #fff;
  font-size: 0.85rem;
}
.pov-reset-steps__step.is-current::before,
.pov-reset-steps__step.is-done::before { background: var(--pov-accent); }

/* ---------- Badge + heading ---------- */
.pov-forgot__badge {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 107, 53, 0.35);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 154, 98, 0.22), rgba(255, 107, 53, 0.08));
  box-shadow: 0 10px 30px -10px rgba(255, 107, 53, 0.5);
  color: #ff9a62;
  font-size: 1.55rem;
}
.pov .pov-forgot h1 {
  margin: 0 0 0.45rem;
  color: #fff;
  font-family: var(--pov-font-quote);
  font-size: clamp(2.1rem, 5.5vw, 2.55rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
}
.pov-forgot__sub { margin: 0 0 1.15rem; color: var(--pov-text-muted); font-size: 0.9rem; line-height: 1.6; }
.pov-forgot__sub b { color: var(--pov-text); font-weight: 600; overflow-wrap: anywhere; }

/* Email pill (page 2) */
.pov-forgot__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  margin: -0.55rem 0 1.1rem;
  padding: 0.35rem 0.4rem 0.35rem 0.8rem;
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: var(--pov-r-pill);
  background: rgba(255, 107, 53, 0.12);
  color: #ff9a62;
  font-size: 0.82rem;
  font-weight: 600;
}
.pov-forgot__pill-email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pov-forgot__pill a {
  flex-shrink: 0;
  padding: 0.2rem 0.65rem;
  border-radius: var(--pov-r-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--pov-text);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
}
.pov-forgot__pill a:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* ---------- Form + buttons ---------- */
.pov-forgot__form { display: grid; gap: 0.8rem; }
.pov-forgot__submit { margin-top: 0.35rem; font-family: var(--pov-font-body); font-weight: 700; }

/* Loading spinner (pov-auth-forgot.js adds .is-loading on submit) */
.pov-forgot .is-loading { pointer-events: none; }
.pov-forgot__submit.is-loading .bi-arrow-right { display: none; }
.pov-forgot__submit.is-loading::after,
.pov-forgot__ghost.is-loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(31, 10, 2, 0.3);
  border-top-color: var(--pov-accent-ink);
  border-radius: 50%;
  animation: pov-forgot-spin 0.7s linear infinite;
}
.pov-forgot__ghost.is-loading::after { border-color: rgba(255, 154, 98, 0.3); border-top-color: #ff9a62; }
@keyframes pov-forgot-spin { to { transform: rotate(360deg); } }

/* Resend (separate form, page 2) */
.pov-forgot__resend { margin: 0.7rem 0 0; }
.pov-forgot__ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 46px;
  border: 1px solid var(--pov-border-strong);
  border-radius: var(--pov-r-pill);
  background: rgba(255, 255, 255, 0.04);
  color: #ff9a62;
  font-family: var(--pov-font-body);
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.2s, background-color 0.2s;
}
.pov-forgot__ghost:hover:not(:disabled) { border-color: var(--pov-accent); background: rgba(255, 107, 53, 0.1); }
.pov-forgot__ghost:focus-visible { outline: 2px solid var(--pov-accent); outline-offset: 2px; }
.pov-forgot__ghost:disabled { opacity: 0.5; cursor: not-allowed; }

.pov-forgot__switch { margin: 1.1rem 0 0; color: var(--pov-text-muted); font-size: 0.88rem; text-align: center; }
.pov-forgot__switch a { color: var(--pov-accent); font-weight: 600; text-decoration: none; }
.pov-forgot__switch a:hover { color: var(--pov-accent-hover); text-decoration: underline; }

/* ---------- OTP: 6 digit boxes → one hidden `otp` input ---------- */
.pov-otp {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
}
.pov-otp[hidden],
[data-pov-otp-error][hidden],
[data-pov-otp-fallback][hidden] { display: none; }
.pov-otp__box {
  width: 100%;
  min-width: 0;
  height: 58px;
  padding: 0;
  border: 1px solid var(--pov-border-strong);
  border-radius: var(--pov-r-md);
  outline: 0;
  background: var(--field-bg);
  color: var(--pov-text);
  caret-color: var(--pov-accent);
  font-family: var(--pov-font-body);
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.pov-otp__box.is-filled { border-color: rgba(255, 107, 53, 0.5); background: rgba(255, 107, 53, 0.08); }
.pov-otp__box:focus { border-color: var(--pov-accent); box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.2); transform: translateY(-2px); }
.pov-otp__box.is-invalid { border-color: rgba(255, 92, 122, 0.6); }
.pov-otp.is-shaking { animation: pov-otp-shake 0.4s ease; }
@keyframes pov-otp-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ---------- Password requirements (page 3) ---------- */
.pov-pw-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.75rem;
  margin: 0.1rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--pov-text-dim);
  font-size: 0.78rem;
}
.pov-pw-rules li { display: flex; align-items: center; gap: 0.45rem; transition: color 0.25s; }
.pov-pw-rules li::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--pov-border-strong);
  border-radius: 50%;
  transition: background-color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.pov-pw-rules li.is-met { color: #7ee8b8; }
.pov-pw-rules li.is-met::before { border-color: var(--pov-success); background: var(--pov-success); box-shadow: inset 0 0 0 3px #0e1630; }
.pov-forgot__hint {
  margin: -0.15rem 0 0.1rem;
  color: var(--pov-text-dim);
  font-size: 0.76rem;
  line-height: 1.75;
}
.pov-forgot__hint:lang(my) { font-family: "Noto Sans Myanmar", var(--pov-font-body); }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .pov-otp { gap: 0.4rem; }
  .pov-otp__box { height: 52px; font-size: 1.25rem; }
  .pov-pw-rules { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .pov-forgot,
  .pov-otp.is-shaking { animation: none; }
  .pov-otp__box:focus { transform: none; }
  .pov-reset-steps__step,
  .pov-pw-rules li,
  .pov-pw-rules li::before { transition: none; }
}
