/* ============================================================
   AUTH-RESET.CSS — Password recovery flow additions
   ────────────────────────────────────────────────────────────
   Layers on top of login.css + auth-rail.css. Provides the
   page-specific components used by the four reset templates:
     • Envelope visual + green dot         (password_reset_done)
     • "Sent to" masked-email card         (password_reset_done)
     • 3-step checklist                    (password_reset_done)
     • Resend row with cooldown            (password_reset_done)
     • Strength meter + live requirements  (password_reset_confirm)
     • Confirm-match badge                 (password_reset_confirm)
     • Animated success check              (password_reset_complete)
     • "Didn't request this?" note         (password_reset_complete)
     • Auto-redirect ticker                (password_reset_complete)

   All class names prefixed `.pwr-*` so they don't collide with
   anything in login.css. Tokens from variables.css.
   ============================================================ */

/* ── Envelope visual (Email sent) ──────────────────────────── */
.pwr-envelope{
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary-subtle), #fff);
  border: 1px solid var(--clr-primary-tint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-bottom: var(--space-1);
  box-shadow:
    0 4px 16px rgba(13, 148, 136, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
}
.pwr-envelope i{
  font-size: 42px;
  color: var(--clr-primary-dark);
  font-variation-settings: 'FILL' 0, 'wght' 400;
}
/* Green "delivered" dot in the top-right of the envelope */
.pwr-envelope::after{
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--clr-success);
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.12);
}

/* ── "Sent to {email}" card ────────────────────────────────── */
.pwr-sent-to{
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.pwr-sent-to__ico{
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--clr-primary-subtle);
  color: var(--clr-primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pwr-sent-to__ico i{ font-size: 18px; }
.pwr-sent-to__body{
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.pwr-sent-to__label{
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--clr-text-faint);
}
.pwr-sent-to__addr{
  font-size: 14.5px;
  font-weight: 600;
  color: var(--clr-text-dark);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pwr-sent-to__addr .pwr-mask{
  letter-spacing: 0.06em;
  color: var(--clr-text-muted);
  font-weight: 500;
}
.pwr-sent-to__edit{
  font-size: 12px;
  font-weight: 600;
  color: var(--clr-primary-dark) !important;
  padding: var(--space-1) var(--space-2);
  border-radius: 8px;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.pwr-sent-to__edit:hover{
  background: var(--clr-primary-subtle);
  text-decoration: none;
}

/* ── 3-step checklist ──────────────────────────────────────── */
.pwr-checklist{
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 13.5px;
  color: var(--clr-text-body);
  line-height: 1.55;
}
.pwr-checklist li{
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.pwr-checklist__num{
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--clr-bg-paper);
  border: 1px solid var(--clr-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--clr-text-muted);
  font-family: var(--font-display);
  margin-top: 1px;
}
.pwr-checklist b{ color: var(--clr-text-dark); font-weight: 600; }

/* ── Resend row with cooldown ──────────────────────────────── */
.pwr-resend{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-1) 0;
  border-top: 1px dashed var(--clr-border);
  margin-top: var(--space-1);
}
.pwr-resend__label{
  font-size: 13px;
  color: var(--clr-text-muted);
}
.pwr-resend__btn{
  font-size: 13px;
  font-weight: 600;
  color: var(--clr-primary-dark);
  background: transparent;
  border: 0;
  padding: var(--space-1) var(--space-3);
  border-radius: 8px;
  transition: background var(--transition-fast), color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-family: inherit;
}
.pwr-resend__btn:hover:not(:disabled){
  background: var(--clr-primary-subtle);
}
.pwr-resend__btn:disabled{
  color: var(--clr-text-faint);
  cursor: not-allowed;
}
.pwr-resend__btn i{ font-size: 15px; }
.pwr-cooldown{ font-variant-numeric: tabular-nums; }

/* ── Strength meter (Set new password) ─────────────────────── */
.pwr-strength{
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.pwr-strength__bar{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.pwr-strength__bar span{
  height: 5px;
  border-radius: 3px;
  background: var(--clr-slate-200);
  transition: background 0.2s ease;
}
/* Coloured segments fill in based on score */
.pwr-strength[data-level="1"] .pwr-strength__bar span:nth-child(-n+1),
.pwr-strength[data-level="2"] .pwr-strength__bar span:nth-child(-n+2),
.pwr-strength[data-level="3"] .pwr-strength__bar span:nth-child(-n+3),
.pwr-strength[data-level="4"] .pwr-strength__bar span:nth-child(-n+4){
  background: currentColor;
}
.pwr-strength[data-level="0"]{ color: var(--clr-slate-300); }
.pwr-strength[data-level="1"]{ color: #DC2626; }
.pwr-strength[data-level="2"]{ color: #D97706; }
.pwr-strength[data-level="3"]{ color: #65A30D; }
.pwr-strength[data-level="4"]{ color: #16A34A; }

.pwr-strength__meta{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--clr-text-muted);
}
.pwr-strength__label{
  font-weight: 600;
  color: currentColor;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Live requirements checklist ───────────────────────────── */
.pwr-reqs{
  list-style: none;
  padding: var(--space-3) var(--space-4);
  margin: var(--space-2) 0 0;
  background: var(--clr-bg-paper);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-4);
}
.pwr-reqs li{
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12.5px;
  color: var(--clr-text-muted);
  line-height: 1.3;
  transition: color 0.2s ease;
}
.pwr-reqs li i{
  font-size: 16px;
  color: var(--clr-slate-300);
  transition: color 0.2s ease;
}
.pwr-reqs li.is-met{ color: var(--clr-text-dark); }
.pwr-reqs li.is-met i{
  color: var(--clr-success);
  font-variation-settings: 'FILL' 1, 'wght' 600;
}

/* ── Confirm-match badge ───────────────────────────────────── */
.pwr-label-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}
.pwr-match{
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: var(--clr-bg-paper);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-faint);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.pwr-match i{ font-size: 14px; }
.pwr-match.is-match{
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #15803D;
}
.pwr-match.is-miss{
  background: #FEF2F2;
  border-color: #FECACA;
  color: #B91C1C;
}

/* ── Animated success check (Reset complete) ───────────────── */
.pwr-check{
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #F0FDF4;
  border: 2px solid #BBF7D0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  box-shadow:
    0 4px 20px rgba(22, 163, 74, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  position: relative;
  animation: pwr-pop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
@keyframes pwr-pop{
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}
.pwr-check svg{ width: 54px; height: 54px; }
.pwr-check__ring,
.pwr-check__tick{
  fill: none;
  stroke: var(--clr-success);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pwr-check__ring{
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: pwr-ring 0.6s ease-out 0.1s forwards;
}
.pwr-check__tick{
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: pwr-tick 0.4s ease-out 0.55s forwards;
}
@keyframes pwr-ring{ to { stroke-dashoffset: 0; } }
@keyframes pwr-tick{ to { stroke-dashoffset: 0; } }

/* Respect reduced motion — skip the entrance animation. */
@media (prefers-reduced-motion: reduce){
  .pwr-check,
  .pwr-check__ring,
  .pwr-check__tick{ animation: none; stroke-dashoffset: 0; }
}

/* ── "Didn't request this?" security note ──────────────────── */
.pwr-note{
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--clr-bg-paper);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  font-size: 13px;
  color: var(--clr-text-body);
  line-height: 1.5;
}
.pwr-note__ico{
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--clr-primary-subtle);
  color: var(--clr-primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pwr-note__ico i{ font-size: 18px; }
.pwr-note b{ color: var(--clr-text-dark); font-weight: 600; }

/* ── Auto-redirect ticker ──────────────────────────────────── */
.pwr-redirect{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--clr-text-faint);
  margin-top: var(--space-1);
}
.pwr-redirect__spin{
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--clr-slate-200);
  border-top-color: var(--clr-primary);
  animation: pwr-spin 1s linear infinite;
}
@keyframes pwr-spin{ to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce){
  .pwr-redirect__spin{ animation: none; }
}

/* ──────────────────────────────────────────────────────────────────
   Field scaffolding for the recovery + change flows.
   login.css already supplies .glass-form / .form-control /
   .input-icon* / .has-icon / .toggle-password / .btn-primary /
   .signup-msg / .password-wrapper. These add the explicit label,
   group, intro-stack and error pieces these templates introduce.
   Uses the global design tokens (variables.css) — no hex literals.
   ────────────────────────────────────────────────────────────────── */
.stack-sm{ display:flex; flex-direction:column; gap:.4rem; margin-bottom:1.25rem; }
.stack-sm h1{
  font-family:var(--font-editorial, 'Newsreader', Georgia, serif);
  font-size:1.7rem; line-height:1.15; font-weight:600; margin:0;
  color:var(--clr-text-dark);
}
.stack-sm h1 em{ font-style:italic; color:var(--clr-primary); }
.stack-sm p{ margin:0; font-size:var(--text-sm); line-height:1.55; color:var(--clr-text-muted); }

.form-group{ display:flex; flex-direction:column; }
.form-label{ font-size:.82rem; font-weight:600; color:var(--clr-text-dark); margin-bottom:.45rem; }

.form-error{ display:flex; align-items:center; gap:6px; margin-top:.45rem; color:var(--clr-danger, #dc2626); font-size:.82rem; }
.form-error i{ font-size:14px; flex-shrink:0; }

/* the text label inside .btn-primary (icon sits beside it) */
.auth-submit-label{ font-weight:inherit; }
