.forgot-page {
    min-height: calc(100vh - var(--header-h) - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    background: radial-gradient(650px 420px at 80% 10%, rgba(109,40,217,.10), transparent 62%), radial-gradient(560px 380px at 15% 90%, rgba(245,158,11,.08), transparent 62%);
}

.forgot-card {
    width: min(100%, 660px);
    padding: 2rem 2.1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--sh-lg);
}

.forgot-head {
    text-align: center;
}

.forgot-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-soft), var(--primary-soft-cat));
    color: var(--primary);
    font-size: 1.7rem;
}

.forgot-head h1 {
    margin: .35rem 0 .4rem;
    color: var(--ink);
    font-size: 1.45rem;
    font-weight: 800;
}

.forgot-head p {
    margin: 0 auto;
    max-width: 450px;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.9;
}

.forgot-alert {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin: 1.25rem 0 1rem;
    padding: .7rem .85rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: .8rem;
    line-height: 1.8;
}

.forgot-alert[hidden] {
    display: none;
}

.forgot-alert.is-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.forgot-alert.is-error {
    background: var(--danger-soft);
    border-color: #fecdd3;
    color: #9f1239;
}

.forgot-alert.is-success {
    background: var(--success-soft);
    border-color: #a7f3d0;
    color: #065f46;
}

.forgot-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    margin: 1.25rem 0 1.5rem;
    padding: .35rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.forgot-method {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: .55rem;
    padding: .75rem .8rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    text-align: right;
    cursor: pointer;
    transition: border-color .18s, background .18s, color .18s, box-shadow .18s;
}

.forgot-method i {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fff;
    color: var(--primary);
    font-size: 1rem;
}

.forgot-method span {
    color: var(--ink);
    font-size: .84rem;
    font-weight: 800;
}

.forgot-method small {
    color: var(--muted-2);
    font-size: .68rem;
}

.forgot-method:hover {
    color: var(--primary);
    background: #fff;
}

.forgot-method.is-active {
    border-color: var(--primary-line);
    background: #fff;
    box-shadow: 0 5px 16px rgba(109,40,217,.10);
}

.forgot-method.is-active i {
    background: var(--primary-soft);
}

.forgot-panel[hidden],
.forgot-complete[hidden],
.forgot-otp-panel[hidden] {
    display: none;
}

.forgot-panel {
    animation: forgot-panel-in .24s ease-out;
}

@keyframes forgot-panel-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.forgot-panel-heading {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.1rem;
}

.forgot-panel-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.1rem;
}

.forgot-panel-heading h2 {
    margin: 0 0 .18rem;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
}

.forgot-panel-heading p {
    margin: 0;
    color: var(--muted);
    font-size: .76rem;
}

.forgot-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: 100%;
    min-height: 46px;
    margin-top: 1rem;
    border-radius: 12px;
    font-size: .86rem;
    font-weight: 800;
}

.forgot-submit:disabled {
    cursor: wait;
    opacity: .72;
}

.forgot-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: forgot-spin .7s linear infinite;
}

@keyframes forgot-spin {
    to { transform: rotate(360deg); }
}

.forgot-complete {
    margin-top: 1rem;
    padding: 1.25rem 1rem;
    border: 1px solid #bbf7d0;
    border-radius: 16px;
    background: #f0fdf4;
    text-align: center;
}

.forgot-complete-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0 auto .7rem;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    font-size: 1.25rem;
}

.forgot-complete h3,
.forgot-otp-topline h3 {
    margin: 0 0 .35rem;
    color: var(--ink);
    font-size: .98rem;
    font-weight: 800;
}

.forgot-complete p {
    margin: 0 auto .9rem;
    max-width: 390px;
    color: #166534;
    font-size: .78rem;
    line-height: 1.8;
}

.forgot-secondary {
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: .76rem;
    font-weight: 700;
}

.forgot-resend,
.forgot-edit {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-family: inherit;
    font-size: .76rem;
    font-weight: 800;
    cursor: pointer;
}

.forgot-resend {
    display: block;
    margin: .7rem auto 0;
}

.forgot-resend:disabled {
    color: var(--muted-2);
    cursor: not-allowed;
}

.forgot-resend span {
    display: inline-block;
    min-width: 2.3em;
    direction: ltr;
    text-align: left;
}

.forgot-otp-panel {
    margin-top: 1.35rem;
    padding: 1.15rem;
    border: 1px solid var(--primary-line);
    border-radius: 17px;
    background: linear-gradient(180deg, var(--primary-soft), #fff 75%);
}

.forgot-otp-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.forgot-step-label {
    display: block;
    margin-bottom: .25rem;
    color: var(--primary);
    font-size: .68rem;
    font-weight: 800;
}

.forgot-edit {
    padding: .25rem .45rem;
    border-radius: 7px;
}

.forgot-edit:hover {
    background: #fff;
}

.forgot-otp-destination {
    margin: .35rem 0 1rem;
    color: var(--muted);
    font-size: .76rem;
}

.forgot-otp-destination strong {
    color: var(--ink);
}

.forgot-otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .5rem;
    margin-bottom: 1rem;
}

.forgot-otp-input {
    width: 100%;
    height: 52px;
    padding: 0;
    border: 1.5px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
    outline: 0;
    caret-color: var(--primary);
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.forgot-otp-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(109,40,217,.14);
}

.forgot-otp-input.is-filled {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.forgot-password-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.forgot-otp-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin-top: .9rem;
    color: var(--muted);
    font-size: .76rem;
}

.forgot-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--line);
    text-align: center;
}

.forgot-footer a {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
}

.forgot-footer a:hover {
    color: var(--primary);
}

@media (max-width: 575.98px) {
    .forgot-page {
        align-items: flex-start;
        padding: 1.25rem .75rem;
    }

    .forgot-card {
        padding: 1.45rem 1.1rem 1rem;
        border-radius: 20px;
    }

    .forgot-head h1 {
        font-size: 1.2rem;
    }

    .forgot-method {
        padding: .65rem .5rem;
    }

    .forgot-method i {
        width: 29px;
        height: 29px;
        font-size: .85rem;
    }

    .forgot-method span {
        font-size: .76rem;
    }

    .forgot-method small {
        font-size: .61rem;
    }

    .forgot-otp-panel {
        padding: .9rem;
    }

    .forgot-password-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .forgot-otp-inputs {
        gap: .3rem;
    }

    .forgot-otp-input {
        height: 46px;
        border-radius: 9px;
        font-size: 1.05rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .forgot-panel,
    .forgot-spinner {
        animation: none;
    }
}
