/* ============================================================
   ForgotPassword.css
   Extends style/PasswordChange.css — do NOT duplicate rules.
   Only new components added by the Forgot Password flow live here.
   ============================================================ */


/* ── Card wrapper (centres the card + progress bar together) ── */
.fp-card-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}


/* ============================================================
   STEP VISIBILITY
   ============================================================ */
.fp-step {
    width: 100%;
    animation: modalSlideIn 0.3s cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* Hidden step: completely removed from layout */
.fp-step--hidden {
    display: none !important;
}


/* ============================================================
   PROGRESS INDICATOR
   ============================================================ */
.fp-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.15rem;
    width: 100%;
    max-width: 460px;       /* matches card max-width on desktop */
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Each step node */
.fp-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

/* Circle dot */
.fp-progress-dot {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #adb5bd;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease,
                box-shadow 0.3s ease;
}

/* Label below dot */
.fp-progress-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #ffffff96;
    transition: color 0.3s ease;
    white-space: nowrap;
}

/* Connecting line */
.fp-progress-line {
    flex: 1;
    height: 2px;
    background: #ffffff4a;
    margin-bottom: 1.25rem;   /* aligns with dot centre (dot h 38px + label ~18px / 2) */
    transition: background 0.4s ease;
    min-width: 16px;           /* slightly narrower than 3-step to fit 4 steps */
}

/* Active step */
.fp-progress-step.active .fp-progress-dot {
    background: #1254a1;
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(18, 84, 161, 0.28);
}
.fp-progress-step.active .fp-progress-label {
    color: #ffffff96;
    font-weight: 600;
}

/* Completed step */
.fp-progress-step.completed .fp-progress-dot {
    background: #e8f0fb;
    border-color: #1254a1;
    color: #1254a1;
}
.fp-progress-step.completed .fp-progress-label {
    color: #ffffff;
}

/* Completed line */
.fp-progress-line.completed {
    background: #ffffff;
}


/* ============================================================
   DESCRIPTION TEXT
   ============================================================ */
.fp-description {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: #666;
    margin-bottom: 1.25rem;
    line-height: 1.55;
}
.fp-description strong {
    color: #1254a1;
    font-weight: 600;
}


/* ============================================================
   INPUT WITH LEFT ICON (login-id step + email step)
   ============================================================ */
.fp-input-icon {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: #1254a1;
    padding:  0.75rem;
    padding-top: 11px;
    padding-bottom: 11px;
    font-size: 1rem;
}

/* When the icon is prepended, adjust the input corner */
.input-group .fp-input-icon + .form-control {
    border-left: none;
    border-radius: 0 8px 8px 0;
}


/* ============================================================
   EMAIL DISPLAY  (disabled, read-only masked email — Step 2)
   ============================================================ */
.fp-email-display {
    background-color: #f4f7fb !important;   /* subtle blue tint to signal it's locked */
    color: #1254a1 !important;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.04em;
    cursor: default;
    /* Override Bootstrap's disabled opacity so the text stays readable */
    opacity: 1 !important;
}

.fp-email-display:disabled {
    color: #1254a1 !important;
    background-color: #f4f7fb !important;
    opacity: 1 !important;
}


/* ============================================================
   OTP INPUT GROUP
   ============================================================ */
.fp-otp-group {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.otp-input {
    width: 48px !important;
    height: 52px;
    padding: 0 !important;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    border-radius: 8px !important;     /* override input-group flattening */
    border: 1px solid #e0e0e0 !important;
    color: #1254a1;
    letter-spacing: 0.05em;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    /* remove input-group's border-radius overrides */
    flex: 0 0 48px;
}

.otp-input:focus {
    border-color: #1254a1 !important;
    box-shadow: 0 0 0 3px rgba(18, 84, 161, 0.12) !important;
    outline: none;
}

.otp-input.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.otp-input.otp-filled {
    background-color: #e8f0fb;
    border-color: #1254a1 !important;
}


/* ============================================================
   RESEND ROW
   ============================================================ */
.fp-resend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.fp-timer-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.83rem;
    color: #6c757d;
}
.fp-timer-text strong {
    color: #1254a1;
    font-weight: 600;
}

/* Resend code — styled as a subtle text button */
.fp-link-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.83rem;
    font-weight: 500;
    color: #1254a1;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.fp-link-btn:hover:not(:disabled) {
    color: #0d4a8a;
}
.fp-link-btn:disabled {
    color: #adb5bd;
    text-decoration: none;
    cursor: not-allowed;
}


/* ============================================================
   PASSWORD STRENGTH INDICATOR
   ============================================================ */
.fp-strength-bar-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.5rem;
    /* hidden until user types */
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, height 0.3s ease;
}
.fp-strength-bar-wrap.fp-strength-visible {
    opacity: 1;
    height: 22px;      /* enough for bar + label */
    overflow: visible;
}

.fp-strength-track {
    flex: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 99px;
    overflow: hidden;
}

.fp-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    transition: width 0.35s ease, background-color 0.35s ease;
}

/* Strength levels */
.fp-strength-fill.strength-weak   { width: 33%; background-color: #dc3545; }
.fp-strength-fill.strength-medium { width: 66%; background-color: #fd7e14; }
.fp-strength-fill.strength-strong { width: 100%; background-color: #198754; }

.fp-strength-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 44px;
}
.fp-strength-label.strength-weak   { color: #dc3545; }
.fp-strength-label.strength-medium { color: #fd7e14; }
.fp-strength-label.strength-strong { color: #198754; }


/* ============================================================
   BACK-TO-LOGIN LINK  (in login-id-step footer)
   ============================================================ */
.fp-back-link {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6c757d;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
    margin-right: auto;   /* pushes button to the right */
}
.fp-back-link:hover {
    color: #1254a1;
}


/* ============================================================
   LOADING SPINNER IN BUTTONS  (reused pattern from PasswordChange.js)
   ============================================================ */
.fp-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    display: inline-block;
    animation: fpSpin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes fpSpin {
    to { transform: rotate(360deg); }
}


/* ============================================================
   DESKTOP — card max-width inherited via .passwordPage .modal-content
   (PasswordChange.css already sets max-width: 460px at ≥ 992px)
   ============================================================ */
@media (min-width: 992px) {
    .fp-progress {
        max-width: 460px;
    }
}


/* ============================================================
   MOBILE OVERRIDES
   ============================================================ */
@media (max-width: 768px) {

    /* OTP boxes — slightly smaller on tight screens */
    .otp-input {
        width: 40px !important;
        height: 46px;
        font-size: 1.1rem;
        flex: 0 0 40px;
    }

    .fp-otp-group {
        gap: 0.35rem;
    }

    .fp-resend-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .fp-back-link {
        font-size: 0.8rem;
    }

    /* 4-step progress — tighten dots slightly on mobile */
    .fp-progress-dot {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .fp-progress-label {
        font-size: 0.68rem;
    }

    .fp-progress-line {
        min-width: 10px;
    }
}

@media (max-width: 400px) {
    /* Very small screens: shrink OTP boxes further */
    .otp-input {
        width: 34px !important;
        height: 40px;
        font-size: 1rem;
        flex: 0 0 34px;
    }
    .fp-otp-group {
        gap: 0.25rem;
    }

    /* Hide labels on very small screens to prevent overflow */
    .fp-progress-label {
        display: none;
    }

    .fp-progress-dot {
        width: 28px;
        height: 28px;
        font-size: 0.72rem;
    }
}
