/* ==========================================================================
   Forgot / Reset Password — page-specific override
   Builds on the shared Account design system (account.css: lg-* tokens and
   components). This file only adds what the multi-step reset flow needs that
   no other Account page has: the progress stepper, OTP boxes, password
   strength/rules, toasts, and the success panel.
   wwwroot/css/forgotpassword.css
   ========================================================================== */

/* ---- Panels (step visibility) -------------------------------------------- */
.fp-panel {
    display: none;
}

    .fp-panel.is-active {
        display: block;
        animation: fpSlide .32s ease;
    }

@keyframes fpSlide {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: none; }
}

/* ---- Stepper : slim progress track ---------------------------------------- */
.fp-stepper {
    margin-bottom: 34px;
}

.fp-stepper-track {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.fp-step {
    flex: 1;
    min-width: 0;
}

.fp-step-line {
    display: none;
}

.fp-step-dot {
    width: 100%;
    height: 5px;
    border-radius: 6px;
    background: var(--lg-line);
    transition: background .3s ease;
}

.fp-step-num,
.fp-step-tick {
    display: none;
}

.fp-step.is-active .fp-step-dot {
    background: var(--lg-brand);
}

.fp-step.is-done .fp-step-dot {
    background: var(--lg-ok);
}

.fp-step-label {
    margin-top: 8px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--lg-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .55;
    transition: opacity .2s, color .2s;
}

.fp-step.is-active .fp-step-label {
    color: var(--lg-brand);
    opacity: 1;
}

.fp-step.is-done .fp-step-label {
    color: var(--lg-ok);
    opacity: .85;
}

/* ---- OTP field top row (label + resend) ------------------------------------ */
.fp-field-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

/* ---- OTP boxes -------------------------------------------------------------- */
.fp-otp {
    display: flex;
    gap: 10px;
    width: 100%;
    flex-wrap: nowrap;
    align-items: center;
}

.fp-otp-box {
    flex: 1 1 0;
    min-width: 0;
    max-width: 60px;
    height: 46px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    border: 1.5px solid var(--lg-line);
    border-radius: 10px;
    background: #fff;
    color: var(--lg-ink);
    transition: border-color .18s, box-shadow .18s;
    padding: 6px 4px;
}

.fp-otp-box:focus {
    outline: none;
    border-color: var(--lg-ink);
    box-shadow: 0 0 0 4px rgba(11, 11, 15, .1);
}

.fp-otp-box.is-error {
    border-color: var(--lg-err);
    animation: fpShake .3s ease;
}

@keyframes fpShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ---- Password visibility toggle (custom .fp-eye, data-target driven) ------- */
.fp-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
    border-radius: 8px;
}

    .fp-eye svg {
        width: 18px;
        height: 18px;
        fill: #a6a6ad;
    }

    .fp-eye:hover svg {
        fill: var(--lg-muted);
    }

    .fp-eye.is-on svg {
        fill: var(--lg-ink);
    }

    .fp-eye:focus-visible {
        outline: 2px solid var(--lg-ink);
        outline-offset: 2px;
        border-radius: 8px;
    }

/* ---- Links / secondary actions ---------------------------------------------- */
.fp-link {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--lg-ink);
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
}

    .fp-link:disabled {
        color: #b6bcc6;
        cursor: not-allowed;
        text-decoration: none;
    }

    .fp-link:focus-visible {
        outline: 2px solid var(--lg-ink);
        outline-offset: 2px;
        border-radius: 4px;
    }

.fp-change-id {
    display: block;
    margin: 18px auto 0;
    text-align: center;
    width: 100%;
}

.fp-resend {
    text-align: center;
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--lg-muted);
}

.fp-back {
    margin-top: 28px;
    width: 100%;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--lg-muted);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color .15s;
}

    .fp-back:hover {
        color: var(--lg-ink);
    }

    .fp-back:focus-visible {
        outline: 2px solid var(--lg-ink);
        outline-offset: 2px;
        border-radius: 4px;
    }

.fp-back-ico {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

/* ---- Loading state on lg-btn (JS toggles .is-loading) ----------------------- */
.fp-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fpSpin .6s linear infinite;
}

.lg-btn.is-loading .fp-spinner {
    display: inline-block;
}

.lg-btn.is-loading .fp-btn-text {
    opacity: .85;
}

@keyframes fpSpin {
    to { transform: rotate(360deg); }
}

/* ---- Password strength ------------------------------------------------------ */
.fp-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 14px;
}

.fp-strength-bar {
    flex: 1;
    height: 6px;
    border-radius: 6px;
    background: var(--lg-line);
    overflow: hidden;
}

#strengthFill {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 6px;
    background: var(--lg-line);
    transition: width .25s ease, background .25s ease;
}

#strengthFill.weak { background: var(--lg-err); }
#strengthFill.medium { background: var(--lg-warn); }
#strengthFill.strong { background: var(--lg-ok); }

.fp-strength-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--lg-muted);
    min-width: 52px;
    text-align: right;
}

.fp-strength-text.weak { color: var(--lg-err); }
.fp-strength-text.medium { color: var(--lg-warn); }
.fp-strength-text.strong { color: var(--lg-ok); }

/* ---- Password rules ---------------------------------------------------------- */
.fp-rules {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 12px;
}

.fp-rules li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--lg-muted);
    transition: color .18s;
}

.fp-rules li i {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1.5px solid #d1d5db;
    background: #fff;
    position: relative;
    transition: all .18s;
}

.fp-rules li.is-ok {
    color: var(--lg-ink);
}

    .fp-rules li.is-ok i {
        background: var(--lg-ok);
        border-color: var(--lg-ok);
    }

    .fp-rules li.is-ok i::after {
        content: '';
        position: absolute;
        left: 4px;
        top: 1px;
        width: 4px;
        height: 8px;
        border: solid #fff;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }

/* ---- Success panel ------------------------------------------------------------ */
.fp-done {
    text-align: center;
    padding: 12px 0 0;
}

.fp-done-ico {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 26px rgba(16,185,129,.28);
}

    .fp-done-ico svg {
        width: 30px;
        height: 30px;
        fill: #fff;
    }

.fp-done h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--lg-ink);
}

.fp-done p {
    color: var(--lg-muted);
    font-size: 13.5px;
    margin: 0;
    line-height: 1.5;
}

/* ---- Toasts (JS builds .fp-toast / .fp-toast-ico / .fp-toast-msg) ------------ */
.fp-toasts {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 32px));
}

.fp-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--lg-line);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 12px 30px rgba(17,24,39,.12);
    border-left: 4px solid var(--lg-ink);
    font-size: 13.5px;
    color: var(--lg-ink);
    opacity: 0;
    transform: translateX(16px);
    transition: opacity .25s ease, transform .25s ease;
}

    .fp-toast.show {
        opacity: 1;
        transform: none;
    }

    .fp-toast-success { border-left-color: var(--lg-ok); }
    .fp-toast-error { border-left-color: var(--lg-err); }

.fp-toast-ico {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--lg-ink);
}

.fp-toast-success .fp-toast-ico { background: var(--lg-ok); }
.fp-toast-error .fp-toast-ico { background: var(--lg-err); }

.fp-toast-msg {
    flex: 1;
    line-height: 1.4;
}

/* ---- Responsive tweaks (in addition to account.css's breakpoints) -------------- */
@media (max-width: 640px) {
    .fp-rules {
        grid-template-columns: 1fr;
    }

    .fp-toasts {
        left: 12px;
        right: 12px;
        top: 12px;
        max-width: none;
    }

    .fp-stepper {
        margin-bottom: 24px;
    }

    .fp-stepper-track {
        gap: 5px;
    }

    .fp-step-label {
        font-size: 10.5px;
        margin-top: 6px;
    }

    .fp-otp {
        gap: 6px;
    }

    .fp-otp-box {
        max-width: none;
        height: 44px;
        font-size: 16px;
        padding: 6px 2px;
    }

    .fp-done-ico {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }

        .fp-done-ico svg {
            width: 26px;
            height: 26px;
        }

    .fp-done h2 {
        font-size: 20px;
    }
}

/* ---- end of file ---- */
