:root {
    color-scheme: light;
    --navy: #15203f;
    --purple: #6936df;
    --purple-dark: #5428c5;
    --muted: #667085;
    --line: #d7dbe5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--navy);
    font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
}

a {
    color: var(--purple);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* صفحه احراز هویت */

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 2% 92%,
            #ded9ff 0 13%,
            transparent 13.2%
        ),
        radial-gradient(
            circle at 100% 28%,
            #eeebff 0 17%,
            transparent 17.2%
        ),
        #f8f9ff;
}

.auth-page::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    background:
        linear-gradient(
            135deg,
            transparent 25%,
            rgba(105, 54, 223, 0.035)
        );
}

/* سربرگ */

.auth-header {
    display: flex;
    height: 88px;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(24px, 6vw, 72px);
    background-color: #ffffff;
    box-shadow: 0 3px 16px rgba(21, 32, 63, 0.08);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--navy);
    font-size: 30px;
    font-weight: 800;
}

.auth-brand:hover {
    text-decoration: none;
}

.auth-brand__mark,
.auth-card__logo {
    display: grid;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(145deg, #7544e7, #5a2bd2);
    box-shadow: 0 5px 12px rgba(90, 43, 210, 0.25);
}

.auth-brand__mark {
    width: 48px;
    height: 48px;
    border-radius: 13px;
}

.auth-home-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 600;
}

.auth-home-link svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* کارت اصلی */

.auth-main {
    display: grid;
    min-height: calc(100vh - 88px);
    place-items: center;
    padding: 44px 16px;
}

.auth-card {
    width: min(100%, 590px);
    padding: 32px 38px 28px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 48px rgba(33, 38, 74, 0.13);
}

.auth-card__logo {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 15px;
    font-size: 26px;
    font-weight: 800;
}

.auth-card h1 {
    margin: 0;
    font-size: 28px;
}

.auth-lead {
    margin: 10px 0 25px;
    color: #4d5872;
}

/* تب‌های ورود */

.method-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 25px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.method-tab {
    padding: 12px;
    color: var(--navy);
    font-weight: 700;
}

.method-tab:hover {
    text-decoration: none;
    background-color: #f7f5ff;
}

.method-tab.is-active {
    color: #ffffff;
    background: linear-gradient(120deg, #7540e5, #5c2bd2);
}

/* فرم */

.auth-form {
    text-align: right;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.input-wrap {
    position: relative;
}

.auth-form input {
    width: 100%;
    height: 50px;
    padding: 0 45px 0 14px;
    border: 1px solid #cfd4df;
    border-radius: 9px;
    outline: none;
    color: var(--navy);
    background-color: #ffffff;
    font: inherit;
    direction: ltr;
    text-align: left;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.auth-form input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(105, 54, 223, 0.18);
}

.input-wrap > svg,
.password-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.input-wrap > svg {
    position: absolute;
    top: 14px;
    right: 14px;
    color: #59627a;
}

/* نمایش و مخفی کردن رمز */

.password-toggle {
    position: absolute;
    top: 5px;
    right: 7px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    color: #44506a;
    background-color: transparent;
    cursor: pointer;
}

.password-toggle:focus-visible,
.link-button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(105, 54, 223, 0.35);
    outline-offset: 3px;
}

/* دکمه اصلی */

.primary-button {
    width: 100%;
    min-height: 49px;
    border: 0;
    border-radius: 9px;
    color: #ffffff;
    background: linear-gradient(110deg, #7b40eb, #5d2bd5);
    box-shadow: 0 8px 18px rgba(105, 54, 223, 0.19);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.primary-button:hover {
    background: linear-gradient(110deg, #6d34dc, #4f22bd);
}

.primary-button:focus-visible {
    outline: 3px solid rgba(105, 54, 223, 0.3);
    outline-offset: 3px;
}

/* خطاها و پیام‌ها */

.errorlist {
    margin: 7px 0 0;
    padding: 0;
    color: #b42318;
    font-size: 14px;
    list-style: none;
}

.form-alert,
.message {
    padding: 11px 13px;
    border-radius: 8px;
    text-align: right;
}

.form-alert,
.message--error {
    color: #8f2018;
    background-color: #fef0ee;
}

.form-alert p {
    margin: 0;
}

.message--success {
    color: #12633b;
    background-color: #ecf8f1;
}

.message--info {
    color: #4d3a11;
    background-color: #fff8df;
}

/* جداکننده */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 23px 0 17px;
    color: #667085;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    flex: 1;
    content: "";
    background-color: var(--line);
}

.signup-prompt {
    margin: 0;
}

.signup-prompt a {
    font-weight: 700;
}

.privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 30px 0 0;
    color: #7a8396;
    font-size: 14px;
}

.privacy-note svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

/* رمز یک‌بارمصرف */

.otp-description {
    margin: -8px 0 20px;
    color: #59627a;
}

.mobile-number {
    display: inline-block;
    color: var(--navy);
    font-weight: 700;
    direction: ltr;
}

.otp-field input {
    padding: 0 14px;
    text-align: center;
    letter-spacing: 10px;
    font-size: 22px;
    font-weight: 700;
}

.otp-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    font-size: 14px;
}

.otp-actions form {
    margin: 0;
}

.link-button {
    padding: 5px;
    border: 0;
    color: var(--purple);
    background-color: transparent;
    font: inherit;
    cursor: pointer;
}

/* کپچا */

.captcha-field {
    margin-bottom: 22px;
}

.captcha-control {
    display: grid;
    grid-template-columns:
        190px
        58px
        minmax(180px, 1fr);
    align-items: center;
    gap: 0;
    direction: ltr;
}

.captcha-control img.captcha {
    grid-column: 1;
    grid-row: 1;
    display: block;
    width: 190px;
    height: 58px;
    object-fit: fill;
    border: 1px solid #d3d8e3;
    border-right: 0;
    border-radius: 11px 0 0 11px;
    background-color: #ffffff;
}

.captcha-control input[type="hidden"] {
    display: none;
}

.auth-form .captcha-control input[type="text"] {
    grid-column: 3;
    grid-row: 1;
    width: calc(100% - 14px);
    height: 58px;
    margin-left: 14px;
    padding: 0 16px;
    border: 1px solid #cfd4df;
    border-radius: 11px;
    outline: none;
    color: var(--navy);
    background-color: #ffffff;
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 3px;
    direction: ltr;
    text-align: center;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.auth-form .captcha-control input[type="text"]:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(105, 54, 223, 0.13);
}

.captcha-refresh {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    width: 58px;
    height: 58px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0 11px 11px 0;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #7c3aed,
        #5b21d1
    );
    box-shadow: 0 6px 14px rgba(105, 54, 223, 0.2);
    cursor: pointer;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.captcha-refresh svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.captcha-refresh:hover {
    background: linear-gradient(
        135deg,
        #6d32df,
        #4f1db8
    );
    box-shadow: 0 8px 18px rgba(105, 54, 223, 0.3);
}

.captcha-refresh:focus-visible {
    position: relative;
    z-index: 2;
    outline: 3px solid rgba(105, 54, 223, 0.3);
    outline-offset: 3px;
}

.captcha-refresh:disabled {
    cursor: wait;
    opacity: 0.7;
}

.captcha-refresh.is-loading svg {
    animation: captcha-spin 0.7s linear infinite;
}

.captcha-field .errorlist {
    margin-top: 8px;
    text-align: right;
}

@keyframes captcha-spin {
    to {
        transform: rotate(360deg);
    }
}

/* تبلت و موبایل */

@media (max-width: 640px) {
    .auth-header {
        height: 72px;
        padding: 0 18px;
    }

    .auth-brand {
        font-size: 23px;
    }

    .auth-brand__mark {
        width: 39px;
        height: 39px;
    }

    .auth-home-link {
        font-size: 0;
    }

    .auth-home-link svg {
        width: 26px;
    }

    .auth-main {
        min-height: calc(100vh - 72px);
        align-items: start;
        padding: 24px 12px;
    }

    .auth-card {
        padding: 25px 18px 22px;
        border-radius: 16px;
    }

    .auth-card h1 {
        font-size: 23px;
    }

    .auth-lead {
        font-size: 14px;
    }

    .method-tab {
        padding: 11px 5px;
        font-size: 14px;
    }

    .otp-actions {
        flex-direction: column;
    }

    .captcha-control {
    grid-template-columns:
        minmax(0, 1fr)
        52px;
    }

    .captcha-control img.captcha {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        height: 52px;
    }

    .captcha-refresh {
        grid-column: 2;
        grid-row: 1;
        width: 52px;
        height: 52px;
    }

    .auth-form .captcha-control input[type="text"] {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        height: 52px;
        margin-top: 10px;
        margin-left: 0;
    }
}


/* کاهش حرکت */

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }

    .captcha-refresh.is-loading svg {
        animation: none;
    }
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    text-decoration: none;
}

.auth-brand__logo {
    display: block;
    width: auto;
    height: 64px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .auth-brand__logo {
        height: 52px;
    }
}
.password-toggle::after {
    content: "";
    position: absolute;
    width: 25px;
    height: 2px;
    border-radius: 2px;
    background-color: currentColor;
    transform: rotate(-45deg) scaleX(0);
    transition: transform 0.18s ease;
}

.password-toggle.is-password-visible::after {
    transform: rotate(-45deg) scaleX(1);
}