/**
 * ============================================================
 * @file        assets/css/account-recovery.css
 * @project     PERSEBAYT
 * @version     1.0.0
 * @date        2026-07-24
 * @author      ابانوب شكري
 * @copyright   الملكية الفكرية لشركة المتر
 * @description تصميم صفحات استعادة كلمة المرور والتحقق OTP.
 * ============================================================
 */

:root {
    --recovery-primary: #177245;
    --recovery-primary-dark: #0f5c37;
    --recovery-primary-soft: #eaf8f0;
    --recovery-ink: #172033;
    --recovery-muted: #64748b;
    --recovery-border: #dbe4ee;
    --recovery-danger: #9f1d2e;
    --recovery-danger-soft: #fdecef;
    --recovery-white: #ffffff;
}

.recovery-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
    gap: 24px;
    align-items: stretch;
}

.recovery-shell-single {
    display: block;
    max-width: 720px;
    margin-inline: auto;
}

.recovery-summary {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: clamp(26px, 4vw, 42px);
    color: var(--recovery-white);
    background:
        radial-gradient(circle at 15% 5%, rgba(255, 255, 255, 0.2), transparent 34%),
        linear-gradient(145deg, #115c38 0%, #177245 52%, #24955f 100%);
    box-shadow: 0 20px 48px rgba(17, 92, 56, 0.2);
}

.recovery-summary::after {
    content: "";
    position: absolute;
    inset: auto -70px -90px auto;
    width: 230px;
    aspect-ratio: 1;
    border: 36px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.recovery-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    color: inherit;
    background: rgba(255, 255, 255, 0.15);
    font-size: 0.82rem;
    font-weight: 900;
}

.recovery-summary h2,
.recovery-code-head h2 {
    margin: 16px 0 8px;
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    line-height: 1.35;
}

.recovery-summary > p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
}

.recovery-steps {
    display: grid;
    gap: 14px;
    margin: 28px 0;
    padding: 0;
    list-style: none;
}

.recovery-steps li {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.recovery-steps strong {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.12);
}

.recovery-steps span {
    color: rgba(255, 255, 255, 0.92);
}

.recovery-methods,
.recovery-manual-note {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.08);
}

.recovery-methods small {
    display: block;
    margin-bottom: 9px;
    color: rgba(255, 255, 255, 0.72);
}

.recovery-methods > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recovery-methods span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.85rem;
    font-weight: 800;
}

.recovery-card {
    margin: 0;
    border-radius: 24px;
    padding: clamp(22px, 4vw, 36px);
}

.recovery-code-card {
    min-height: 480px;
}

.recovery-form-head {
    margin-bottom: 24px;
}

.recovery-form-head h3,
.recovery-unavailable h2,
.recovery-unavailable h3,
.recovery-complete h2,
.recovery-complete h3,
.recovery-expired h3 {
    margin: 0 0 6px;
    color: var(--recovery-ink);
    font-size: 1.35rem;
}

.recovery-form-head p,
.recovery-unavailable p,
.recovery-complete p,
.recovery-expired p {
    margin: 0;
    color: var(--recovery-muted);
}

.recovery-code-head {
    text-align: center;
}

.recovery-code-head .recovery-kicker {
    color: var(--recovery-primary-dark);
    background: var(--recovery-primary-soft);
}

.recovery-form .field > span {
    color: #253148;
    font-weight: 850;
}

.recovery-form .field small {
    color: var(--recovery-muted);
    font-size: 0.8rem;
}

.recovery-form .field input,
.recovery-form .field select {
    min-height: 50px;
    border: 1px solid var(--recovery-border);
    background: #fbfdff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.recovery-form .field input:focus,
.recovery-form .field select:focus {
    outline: none;
    border-color: var(--recovery-primary);
    box-shadow: 0 0 0 4px rgba(23, 114, 69, 0.12);
}

.recovery-channel-fieldset {
    margin: 20px 0;
    padding: 0;
    border: 0;
}

.recovery-channel-fieldset legend {
    margin-bottom: 10px;
    color: #253148;
    font-weight: 900;
}

.recovery-channel-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.recovery-channel-options label {
    position: relative;
    display: block;
    cursor: pointer;
}

.recovery-channel-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.recovery-channel-options label > span {
    display: grid;
    gap: 3px;
    min-height: 88px;
    padding: 14px;
    border: 1px solid var(--recovery-border);
    border-radius: 15px;
    background: #fbfdff;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.recovery-channel-options label:hover > span {
    transform: translateY(-1px);
}

.recovery-channel-options input:checked + span {
    border-color: var(--recovery-primary);
    background: var(--recovery-primary-soft);
    box-shadow: inset 0 0 0 1px var(--recovery-primary);
}

.recovery-channel-options input:focus-visible + span {
    outline: 3px solid rgba(23, 114, 69, 0.22);
    outline-offset: 2px;
}

.recovery-channel-options b {
    color: var(--recovery-ink);
}

.recovery-channel-options small {
    color: var(--recovery-muted);
    line-height: 1.6;
}

.recovery-password-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-inline-end: 72px !important;
}

.password-toggle {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    min-width: 58px;
    min-height: 34px;
    border: 0;
    border-radius: 9px;
    color: var(--recovery-primary-dark);
    background: var(--recovery-primary-soft);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
    transform: translateY(-50%);
}

.recovery-review-message {
    margin: 12px 0 18px;
    padding: 12px 14px;
    border-inline-start: 4px solid #d59b18;
    border-radius: 12px;
    color: #6e4d02;
    background: #fff7dd;
}

.recovery-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 6px;
    text-align: center;
}

.recovery-submit:disabled {
    cursor: wait;
    opacity: 0.72;
}

.recovery-login-link {
    margin: 18px 0 0;
    text-align: center;
    color: var(--recovery-muted);
}

.recovery-login-link a,
.recovery-secondary-actions a,
.recovery-link-button {
    color: var(--recovery-primary-dark);
    font-weight: 900;
    text-decoration: none;
}

.recovery-reference {
    margin-top: 10px;
    line-height: 1.7;
}

.recovery-reference strong {
    display: inline-block;
    margin-inline-start: 5px;
    letter-spacing: 0.04em;
}

.recovery-complete,
.recovery-unavailable,
.recovery-expired {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: clamp(24px, 6vw, 54px) 10px;
    text-align: center;
}

.recovery-complete > span {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 5px;
    border-radius: 50%;
    color: var(--recovery-white);
    background: linear-gradient(145deg, #177245, #24955f);
    box-shadow: 0 12px 30px rgba(23, 114, 69, 0.24);
    font-size: 2rem;
    font-weight: 900;
}

.recovery-complete .btn,
.recovery-unavailable .btn {
    min-width: 190px;
    margin-top: 10px;
}

.recovery-otp-field {
    max-width: 340px;
    margin-inline: auto;
    text-align: center;
}

.recovery-otp-field input {
    min-height: 64px !important;
    text-align: center;
    direction: ltr;
    letter-spacing: 0.42em;
    font-size: 1.6rem !important;
    font-weight: 900;
}

.recovery-countdown {
    width: fit-content;
    margin: 6px auto 18px;
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--recovery-primary-dark);
    background: var(--recovery-primary-soft);
    font-size: 0.85rem;
}

.recovery-countdown.expired {
    color: var(--recovery-danger);
    background: var(--recovery-danger-soft);
}

.recovery-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--recovery-border);
}

.recovery-secondary-actions form {
    margin: 0;
}

.recovery-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.recovery-card .alert {
    border: 1px solid transparent;
    line-height: 1.8;
}

.recovery-card .alert.ok {
    border-color: #bfe7cf;
}

.recovery-card .alert.bad {
    border-color: #f5c8d0;
}

@media (max-width: 860px) {
    .recovery-shell {
        grid-template-columns: 1fr;
    }

    .recovery-summary {
        padding: 26px;
    }

    .recovery-steps {
        margin-bottom: 18px;
    }
}

@media (max-width: 600px) {
    .recovery-card,
    .recovery-summary {
        border-radius: 18px;
        padding: 20px;
    }

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

    .recovery-channel-options {
        grid-template-columns: 1fr;
    }

    .recovery-code-card {
        min-height: 0;
    }

    .recovery-otp-field input {
        letter-spacing: 0.28em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .recovery-channel-options label > span,
    .recovery-form .field input,
    .recovery-form .field select {
        transition: none;
    }
}

