.auth-page {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    overflow: hidden;
    color: var(--text);
    isolation: isolate;
}

.auth-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(ellipse at top, var(--bg-2) 0%, var(--bg) 70%);
}
.auth-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        rgba(244, 244, 248, 0.05) 1px,
        transparent 1.6px
    );
    background-size: 26px 26px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(
        ellipse at center,
        black 40%,
        transparent 80%
    );
}
.auth-glow {
    position: absolute;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.35;
    pointer-events: none;
}
.auth-glow-1 {
    top: -200px;
    inset-inline-start: -180px;
    background: rgba(var(--pink-rgb), 0.55);
}
.auth-glow-2 {
    bottom: -220px;
    inset-inline-end: -180px;
    background: rgba(76, 201, 240, 0.35);
}

.auth-shell {
    position: relative;
    width: 100%;
    max-width: var(--container);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
    gap: 40px;
    align-items: center;
    z-index: 2;
}

.auth-side {
    display: flex;
    flex-direction: column;
    gap: 34px;
    padding: 6px 0;
    animation: authFadeUp 0.8s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
    width: fit-content;
}
.auth-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    object-fit: cover;
    transition: transform 0.3s;
}
.auth-brand:hover .auth-brand-logo {
    transform: rotate(-6deg) scale(1.06);
}
.auth-brand-word {
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 1.2rem;
}
.auth-brand-word b {
    font-family: var(--font-en) !important;
    color: var(--pink);
}

.auth-side-body {
    display: flex;
    flex-direction: column;
    gap: 26px;
}
.auth-side-title {
    font-family: var(--font-en);
    font-weight: 800;
    font-size: clamp(1.9rem, 3.2vw, 3rem);
    line-height: 1.15;
    margin: 0;
    gap: 4px;
}
[dir="rtl"] .auth-side-title {
    font-family: var(--font-fa);
}
.auth-side-accent {
    font-family: var(--font-en) !important;
    color: var(--pink);
    font-size: 1.15em;
    text-shadow: 0.05em 0.05em 0 var(--ink),
        0.11em 0.11em 0 rgba(var(--pink-shadow-rgb), 0.3);
}
.auth-side-desc {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.9;
    max-width: 44ch;
    margin: 0;
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.auth-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 18px;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.auth-feature:hover {
    transform: translateX(-4px);
    border-color: var(--pink);
    box-shadow: 0 12px 30px -14px rgba(var(--pink-rgb), 0.4);
}
[dir="ltr"] .auth-feature:hover {
    transform: translateX(4px);
}

.af-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: transform 0.3s;
}
.auth-feature:hover .af-icon {
    transform: scale(1.08) rotate(-6deg);
}
.af-pink {
    background: rgba(var(--pink-rgb), 0.12);
    color: var(--pink);
}
.af-lime {
    background: rgba(191, 230, 90, 0.1);
    color: var(--lime);
}
.af-sky {
    background: rgba(76, 201, 240, 0.1);
    color: var(--sky);
}

.auth-feature > div {
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    min-width: 0;
}
.auth-feature strong {
    font-size: 0.95rem;
    font-weight: 700;
}
.auth-feature small {
    color: var(--muted);
    font-size: 0.78rem;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    width: fit-content;
    transition: color 0.25s, transform 0.25s;
}
.auth-back:hover {
    color: var(--pink);
    transform: translateX(-3px);
}
[dir="ltr"] .auth-back:hover {
    transform: translateX(3px);
}

.auth-card {
    position: relative;
    background: rgba(16, 16, 24, 0.85);
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.85),
        0 0 0 1px rgba(var(--pink-rgb), 0.04) inset;
    animation: authFadeUp 0.8s 0.1s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.auth-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.86rem;
    line-height: 1.6;
    margin-bottom: 20px;
    animation: authFadeUp 0.35s ease both;
}
.auth-alert svg {
    flex-shrink: 0;
}
.auth-alert-error {
    background: rgba(255, 123, 114, 0.1);
    border: 1px solid rgba(255, 123, 114, 0.35);
    color: #ffb4ae;
}
.auth-alert-success {
    background: rgba(126, 231, 135, 0.1);
    border: 1px solid rgba(126, 231, 135, 0.35);
    color: #a7f0ac;
}

.auth-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 26px;
    overflow: hidden;
}
.auth-tab {
    position: relative;
    z-index: 2;
    padding: 12px 8px;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
    border-radius: 11px;
    cursor: pointer;
    transition: color 0.3s;
}
.auth-tab.active {
    color: var(--ink);
}
.auth-tab-pill {
    position: absolute;
    top: 4px;
    inset-inline-start: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--pink);
    border-radius: 11px;
    z-index: 1;
    transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
    box-shadow: 0 8px 22px -8px rgba(var(--pink-rgb), 0.55);
}
.auth-tab-pill.right {
    transform: translateX(100%);
}
[dir="ltr"] .auth-tab-pill.right {
    transform: translateX(100%);
}
[dir="rtl"] .auth-tab-pill {
    right: 4px;
    left: auto;
}
[dir="rtl"] .auth-tab-pill.right {
    transform: translateX(-100%);
}

.auth-forms {
    position: relative;
    display: grid;
    grid-template-areas: "stack";
}
.auth-form {
    grid-area: stack;
    align-self: start;
    opacity: 0;
    display: none;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(0);
    transition: opacity 0.45s ease,
        transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1), visibility 0.45s;
}
.auth-form.active {
    opacity: 1;
    display: block;
    visibility: visible;
    pointer-events: auto;
}
.auth-form.enter-right {
    transform: translateX(50px);
    opacity: 0;
}
.auth-form.enter-left {
    transform: translateX(-50px);
    opacity: 0;
}
.auth-form.exit-left {
    transform: translateX(-50px);
    opacity: 0;
}
.auth-form.exit-right {
    transform: translateX(50px);
    opacity: 0;
}

.auth-form-head {
    text-align: center;
    margin-bottom: 22px;
}
.auth-form-head h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--text);
}
.auth-form-head p {
    color: var(--muted);
    font-size: 0.86rem;
    margin: 0;
    line-height: 1.7;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.auth-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    padding-inline-start: 4px;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-input-icon {
    position: absolute;
    inset-inline-start: 14px;
    color: var(--faint);
    pointer-events: none;
    transition: color 0.25s;
}
.auth-input-wrap input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--text);
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
    -webkit-appearance: none;
    appearance: none;
}
[dir="rtl"] .auth-input-wrap input {
    padding: 14px 44px 14px 16px;
}

.auth-input-wrap input::placeholder {
    color: var(--faint);
}
.auth-input-wrap input:hover {
    border-color: var(--line-strong);
}
.auth-input-wrap input:focus {
    border-color: var(--pink);
    background: var(--panel-2);
    box-shadow: 0 0 0 4px rgba(var(--pink-rgb), 0.12);
}
.auth-input-wrap input:focus + .auth-input-icon,
.auth-input-wrap input:focus ~ .auth-input-icon {
    color: var(--pink);
}
.auth-input-wrap input.invalid {
    border-color: var(--red);
}

.auth-eye {
    position: absolute;
    inset-inline-end: 8px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    color: var(--faint);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.auth-eye:hover {
    color: var(--pink);
    background: rgba(var(--pink-rgb), 0.08);
}
.auth-eye.reveal svg {
    opacity: 0.55;
}

.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.auth-grid-2 .auth-field {
    margin-bottom: 16px;
}

.auth-hint {
    color: var(--red);
    font-size: 0.78rem;
    margin: -6px 4px 14px;
    line-height: 1.6;
}

.auth-meta-row {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 20px;
}

.auth-link {
    color: var(--pink);
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}
.auth-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 22px;
    border-radius: 13px;
    border: none;
    background: var(--pink);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.auth-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.28),
        transparent
    );
    transform: translateX(-110%);
    transition: transform 0.8s;
}
.auth-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -12px rgba(var(--pink-rgb), 0.65);
}
.auth-submit:hover:not(:disabled)::before {
    transform: translateX(110%);
}
.auth-submit:active:not(:disabled) {
    transform: translateY(0);
}
.auth-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
.auth-submit.loading span {
    opacity: 0.6;
}
.auth-submit.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(22, 7, 16, 0.35);
    border-top-color: var(--ink);
    border-radius: 50%;
    inset-inline-end: 22px;
    animation: authSpin 0.7s linear infinite;
}
@keyframes authSpin {
    to {
        transform: rotate(360deg);
    }
}

.auth-single {
    animation: authFadeUp 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.auth-single form {
    margin: 0;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: 18px;
    transition: color 0.25s, transform 0.25s;
}
.auth-back-link:hover {
    color: var(--pink);
    transform: translateX(-3px);
}
[dir="ltr"] .auth-back-link:hover {
    transform: translateX(3px);
}

.auth-email-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 6px 14px;
    background: rgba(var(--pink-rgb), 0.08);
    border: 1px solid rgba(var(--pink-rgb), 0.28);
    color: var(--pink);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    direction: ltr;
}

.code-inputs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 22px;
    direction: ltr;
}
.code-inputs input {
    width: 100%;
    height: 60px;
    text-align: center;
    font-family: var(--font-en);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 13px;
    outline: none;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s,
        transform 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
.code-inputs input:hover {
    border-color: var(--line-strong);
}
.code-inputs input:focus {
    border-color: var(--pink);
    background: var(--panel-2);
    box-shadow: 0 0 0 4px rgba(var(--pink-rgb), 0.12);
    transform: translateY(-2px);
}

.auth-resend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
    font-size: 0.84rem;
}
.auth-resend-btn:disabled {
    color: var(--faint);
    cursor: not-allowed;
    opacity: 0.7;
    text-decoration: none;
}
.auth-resend-timer {
    color: var(--faint);
    font-size: 0.82rem;
    direction: ltr;
}

@media (max-width: 1024px) {
    :root {
        --container: 540px
    }
    .auth-page {
        padding: 90px 20px 40px;
        align-items: flex-start;
    }
    .auth-shell {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .auth-side {
        gap: 20px;
        text-align: center;
        align-items: center;
    }
    .auth-brand {
        align-self: center;
    }
    .auth-side-body {
        align-items: center;
        gap: 18px;
    }
    .auth-side-title {
        font-size: 2rem;
        align-items: center;
    }
    .auth-side-desc {
        font-size: 0.92rem;
        max-width: 46ch;
        text-align: center;
    }
    .auth-features {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 10px;
    }
    .auth-feature {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 14px 10px;
        gap: 8px;
    }
    .auth-feature:hover {
        transform: translateY(-4px);
    }
    [dir="ltr"] .auth-feature:hover {
        transform: translateY(-4px);
    }
    .auth-feature > div {
        align-items: center;
    }
    .auth-back {
        align-self: center;
    }
    .auth-card {
        padding: 28px 26px;
    }
}
@media (max-width: 768px) {
    :root {
        --container: 480px;
    }
    .auth-page {
        padding: 80px 14px 30px;
    }
    .auth-side-title {
        font-size: 1.7rem;
    }
    .auth-side-desc {
        font-size: 0.86rem;
    }
    .auth-feature strong {
        font-size: 0.85rem;
    }
    .auth-feature small {
        font-size: 0.7rem;
    }
    .af-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
    .auth-card {
        padding: 24px 20px;
        border-radius: 20px;
    }
    .auth-form-head h2 {
        font-size: 1.22rem;
    }
    .auth-form-head p {
        font-size: 0.8rem;
    }
    .auth-input-wrap input {
        padding: 13px 14px 13px 42px;
        font-size: 0.9rem;
    }
    [dir="rtl"] .auth-input-wrap input {
        padding: 13px 42px 13px 14px;
    }
    .auth-input-icon {
        inset-inline-start: 12px;
    }
    .auth-submit {
        padding: 14px 20px;
        font-size: 0.92rem;
    }
    .code-inputs {
        gap: 8px;
    }
    .code-inputs input {
        height: 54px;
        font-size: 1.3rem;
        border-radius: 11px;
    }
}
@media (max-width: 480px) {
    .auth-page {
        padding: 74px 10px 24px;
    }
    .auth-shell {
        gap: 18px;
    }
    .auth-side-title {
        font-size: 1.45rem;
    }
    .auth-side-desc {
        font-size: 0.8rem;
        line-height: 1.8;
    }

    .auth-features {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .auth-feature {
        flex-direction: row;
        text-align: start;
        padding: 10px 14px;
        gap: 12px;
    }
    .auth-feature > div {
        align-items: flex-start;
    }

    .auth-card {
        padding: 20px 16px;
        border-radius: var(--radius);
    }
    .auth-tabs {
        padding: 3px;
    }
    .auth-tab {
        padding: 11px 6px;
        font-size: 0.88rem;
    }
    .auth-tab-pill {
        top: 3px;
        inset-inline-start: 3px;
        height: calc(100% - 6px);
    }

    .auth-form-head {
        margin-bottom: 18px;
    }
    .auth-form-head h2 {
        font-size: 1.12rem;
    }
    .auth-form-head p {
        font-size: 0.78rem;
    }

    .auth-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .auth-field {
        margin-bottom: 14px;
    }
    .auth-input-wrap input {
        padding: 12px 14px 12px 40px;
        font-size: 0.88rem;
        border-radius: 11px;
    }
    [dir="rtl"] .auth-input-wrap input {
        padding: 12px 40px 12px 14px;
    }
    .auth-submit {
        padding: 13px 18px;
        font-size: 0.88rem;
        border-radius: 11px;
    }

    .code-inputs {
        gap: 5px;
        margin-bottom: 18px;
    }
    .code-inputs input {
        height: 46px;
        font-size: 1.15rem;
        border-radius: 9px;
    }
}