/* =============================================================================
   FILE: assets/css/forgot-password.css
   PROJECT: Smart Bookmark
   PURPOSE: Styles specific to the Forgot Password page (forgot-password.html).
            Loaded after login.css — inherits all card, form, button, and alert
            styles.  Only adds the multi-step transition logic and the success
            screen.

   SECTIONS:
     1. Step system       — show/hide/transition between steps
     2. OTP digit widget  — reused from signup.css (same .st-verify-digit class)
     3. Success screen    — check-mark icon + message
     4. Responsive        — mobile overrides
============================================================================= */


/* =============================================================================
   1. STEP SYSTEM
   The card contains four sibling divs (.fp-step).  JS controls which is
   visible by toggling .fp-step--hidden and .fp-step--active.
   Smooth cross-fades use CSS transitions, no JS animation libraries needed.
============================================================================= */

.fp-card {
  /* Allow absolute-positioned success icon to stay within the card */
  position: relative;
  overflow: hidden;
}

/* Every step is in normal flow by default.
   We show/hide by toggling visibility + opacity so the card height is always
   driven by the visible step (unlike absolute overlay patterns). */
.fp-step {
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 1;
  transform: translateY(0);
}

.fp-step--hidden {
  display: none;
}

/* Entering step: fade + slide up */
.fp-step--entering {
  animation: fpStepIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fpStepIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =============================================================================
   2. OTP DIGIT WIDGET
   .st-verify-digit and supporting classes are defined in signup.css.
   This page loads login.css (not signup.css), so we re-declare the minimal
   set needed here.  The selectors are identical so both pages behave the same.
============================================================================= */

/* Envelope icon badge — same as in signup.css */
.otp-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(129, 140, 248, 0.18));
  border: 1.5px solid rgba(99, 102, 241, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--clr-indigo-500);
  flex-shrink: 0;
}

.otp-icon svg {
  width: 24px;
  height: 24px;
}

.otp-header {
  text-align: center;
  margin-bottom: 24px;
}

.otp-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--clr-brand-900);
  margin: 0 0 8px;
  letter-spacing: -0.025em;
}

.otp-subtitle {
  font-size: 0.875rem;
  color: var(--clr-brand-600);
  line-height: 1.55;
  margin: 0;
}

.otp-subtitle strong {
  color: var(--clr-brand-900);
  font-weight: 600;
}

.otp-digits {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.st-verify-digit {
  width: 44px;
  height: 52px;
  padding: 0;
  background: var(--clr-brand-50);
  border: 1.5px solid var(--clr-brand-200);
  border-radius: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--clr-brand-900);
  font-family: 'Courier New', Courier, monospace;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  box-sizing: border-box;
  caret-color: transparent;
}

.st-verify-digit:focus {
  border-color: var(--clr-indigo-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.st-verify-digit--error {
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12) !important;
}

.otp-error {
  font-size: 0.8125rem;
  color: #f43f5e;
  text-align: center;
  margin: 0 0 12px;
  min-height: 1.15em;
}

.otp-error[hidden] { display: none; }

.otp-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.btn-back {
  flex-shrink: 0;
  background: none;
  border: 1.5px solid var(--clr-brand-200);
  border-radius: var(--radius-md);
  padding: 0 16px;
  height: 44px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--clr-brand-600);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition),
              background var(--transition);
  white-space: nowrap;
}

.btn-back:hover {
  border-color: var(--clr-indigo-400);
  color: var(--clr-indigo-500);
  background: rgba(99, 102, 241, 0.05);
}

.otp-footer .btn-primary {
  flex: 1;
}


/* =============================================================================
   3. SUCCESS SCREEN
============================================================================= */

#stepSuccess {
  text-align: center;
  padding: 8px 0 0;
}

.fp-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(129, 140, 248, 0.18));
  border: 1.5px solid rgba(99, 102, 241, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--clr-indigo-500);
  animation: fpSuccessIconPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fp-success-icon svg {
  width: 28px;
  height: 28px;
}

@keyframes fpSuccessIconPop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.fp-success-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--clr-brand-900);
  margin: 0 0 10px;
  letter-spacing: -0.025em;
}

.fp-success-msg {
  font-size: 0.9rem;
  color: var(--clr-brand-600);
  line-height: 1.6;
  margin: 0 0 28px;
}

.fp-success-btn {
  display: inline-flex;
  text-decoration: none;
  max-width: 220px;
  margin: 0 auto;
}


/* =============================================================================
   4. RESPONSIVE
============================================================================= */

@media (max-width: 768px) {
  .otp-digits {
    gap: 6px;
  }

  .st-verify-digit {
    width: 40px;
    height: 48px;
    font-size: 1.35rem;
  }
}
