:root {
    --login-accent: #7c3aed;
    --login-secondary: #0f9388;
    --login-bg: linear-gradient(135deg, #f8fbff 0%, #eef2ff 38%, #ecfeff 100%);
    --login-ink: #101828;
    --login-muted: #667085;
    --login-line: rgba(124, 58, 237, .16);
    --login-glass: rgba(255, 255, 255, .80);
    --login-shadow: 0 28px 86px rgba(15, 23, 42, .16);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    height: auto;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--login-ink);
    background: var(--login-bg);
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-family: "Shabnam", "Vazirmatn", Tahoma, Arial, sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -4;
    background:
        linear-gradient(rgba(124, 58, 237, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 147, 136, .045) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: .85;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    background:
        radial-gradient(circle at 16% 18%, color-mix(in srgb, var(--login-accent) 18%, transparent), transparent 26rem),
        radial-gradient(circle at 84% 18%, color-mix(in srgb, var(--login-secondary) 18%, transparent), transparent 24rem),
        linear-gradient(120deg, transparent 0 32%, rgba(255,255,255,.50) 48%, transparent 64%);
    background-size: auto, auto, 240% 240%;
}

.auth-bg-animated::before {
    animation: authGridMove 18s linear infinite;
}

.auth-bg-animated::after {
    animation: authLightSweep 12s ease-in-out infinite;
}

.auth-bg-image {
    background: #101828;
}

.auth-bg-image::before {
    display: none;
}

img.background-image {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -5;
}

.auth-bg-image::after {
    background:
        linear-gradient(135deg, rgba(15,23,42,.64), rgba(15,23,42,.28)),
        radial-gradient(circle at 18% 18%, rgba(124,58,237,.28), transparent 25rem);
}

.auth-bg-image.auth-bg-animated::after {
    background:
        linear-gradient(135deg, rgba(15,23,42,.60), rgba(15,23,42,.24)),
        radial-gradient(circle at 18% 18%, rgba(124,58,237,.34), transparent 24rem),
        radial-gradient(circle at 82% 78%, rgba(15,147,136,.26), transparent 22rem);
}

.auth-animated-background {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.auth-bg-image .auth-animated-background {
    mix-blend-mode: screen;
    opacity: .72;
}

.auth-atom {
    position: absolute;
    width: 220px;
    height: 220px;
    opacity: .46;
}

.auth-bg-image .auth-atom {
    opacity: .54;
}

.auth-atom::before {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--login-accent) 8%, transparent), inset 0 0 22px color-mix(in srgb, var(--login-secondary) 12%, transparent);
}

.auth-atom.a { right: 7%; top: 12%; }
.auth-atom.b { left: 8%; bottom: 10%; width: 170px; height: 170px; transform: rotate(-10deg); }
.auth-atom.c { left: 43%; top: 8%; width: 124px; height: 124px; opacity: .28; transform: rotate(15deg); }

.auth-atom.b > i::after,
.auth-atom.b > b::after,
.auth-atom.b > em::after {
    animation-duration: 6.8s;
}

.auth-atom.c > i::after,
.auth-atom.c > b::after,
.auth-atom.c > em::after {
    animation-duration: 5.6s;
}

.container {
    position: relative;
    z-index: 2;
}

body > .container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

body > .container > main {
    width: 100%;
}

.auth-page {
    width: 100%;
    padding: 28px 14px 108px;
}

.auth-brand-link {
    display: inline-grid;
    justify-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--login-ink);
    font-weight: 900;
}

.logo-img {
    max-width: 116px;
    height: auto;
    filter: drop-shadow(0 14px 30px rgba(15, 23, 42, .14));
}

.auth-brand-link span {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(255,255,255,.72);
    box-shadow: 0 14px 34px rgba(15,23,42,.08);
    backdrop-filter: blur(14px);
}

.auth-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .72) !important;
    border-radius: 28px !important;
    background: var(--login-glass) !important;
    box-shadow: var(--login-shadow) !important;
    backdrop-filter: blur(22px);
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--login-accent), #2563eb, var(--login-secondary));
}

.auth-card::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    left: -90px;
    top: -110px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--login-accent) 15%, transparent), transparent 68%);
    pointer-events: none;
}

.auth-card-heading {
    position: relative;
    z-index: 1;
    text-align: right;
    margin-bottom: 20px;
}

.auth-card-kicker {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 0 12px;
    background: color-mix(in srgb, var(--login-accent) 10%, white);
    color: var(--login-accent);
    border: 1px solid color-mix(in srgb, var(--login-accent) 20%, transparent);
    font-weight: 900;
    font-size: 12px;
}

.auth-card-heading h1 {
    margin: 14px 0 8px;
    font-size: clamp(25px, 4vw, 36px);
    line-height: 1.35;
    font-weight: 950;
    letter-spacing: 0;
}

.auth-card-heading p {
    margin: 0;
    color: var(--login-muted);
    line-height: 1.9;
}

.auth-tabs {
    position: relative;
    z-index: 1;
    padding: 5px;
    border-radius: 18px;
    background: rgba(255,255,255,.66);
    border: 1px solid rgba(255,255,255,.70);
}

.tab-content,
.tab-pane,
.auth-card form {
    position: relative;
    z-index: 1;
}

.nav-pills .nav-link {
    min-height: 42px;
    border-radius: 14px !important;
    color: var(--login-accent);
    font-weight: 900;
}

.nav-pills .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--login-accent), var(--login-secondary)) !important;
    box-shadow: 0 14px 30px color-mix(in srgb, var(--login-accent) 24%, transparent);
}

.form-label {
    color: var(--login-ink);
    font-weight: 850;
    margin-bottom: 8px;
}

.form-control {
    min-height: 48px;
    border-radius: 15px;
    border-color: rgba(148,163,184,.38);
    background-color: rgba(255,255,255,.84);
}

.form-control:focus {
    border-color: color-mix(in srgb, var(--login-accent) 52%, white);
    box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--login-accent) 16%, transparent);
}

.form-check {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 9px;
    padding-right: 0;
    padding-left: 0;
    text-align: right;
}

.form-check-input {
    float: none;
    margin: 0 !important;
    flex: 0 0 auto;
}

.form-check-label {
    margin: 0;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--login-accent);
    border-color: var(--login-accent);
}

.btn-primary,
.auth-submit {
    min-height: 50px;
    border: 0;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--login-accent), var(--login-secondary));
    box-shadow: 0 18px 38px color-mix(in srgb, var(--login-accent) 24%, transparent);
    font-weight: 950;
    transition: transform .2s ease, box-shadow .2s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.auth-submit:hover,
.auth-submit:focus {
    transform: translateY(-2px);
    box-shadow: 0 24px 52px color-mix(in srgb, var(--login-accent) 28%, transparent);
}

.btn-outline-primary {
    border-color: color-mix(in srgb, var(--login-accent) 35%, white);
    color: var(--login-accent);
    border-radius: 14px;
    font-weight: 900;
}

.btn-outline-primary:hover {
    background: var(--login-accent);
    border-color: var(--login-accent);
}

.alert {
    border-radius: 16px;
}

@keyframes authGridMove {
    to { background-position: 44px 44px, 44px 44px; }
}

@keyframes authLightSweep {
    0%, 100% { background-position: 0 0, 0 0, -60% 50%; }
    50% { background-position: 0 0, 0 0, 130% 50%; }
}

@keyframes authRingSpin {
    to { transform: rotate(360deg); }
}

@keyframes authLineScan {
    0%, 100% { opacity: .18; filter: saturate(1); }
    50% { opacity: .72; filter: saturate(1.35); }
}

@keyframes authPulseMove {
    0%, 100% { transform: translate3d(0,0,0) scale(1); opacity: .55; }
    50% { transform: translate3d(24px,-20px,0) scale(1.15); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 576px) {
    html,
    body {
        height: auto !important;
        min-height: 100%;
        overflow-y: auto !important;
    }

    body {
        display: block !important;
        align-items: stretch;
        padding-bottom: 0 !important;
    }

    body > .container {
        display: block !important;
        width: 100%;
        max-width: none;
        min-height: 0 !important;
        height: auto !important;
        padding-right: 0;
        padding-left: 0;
        align-items: flex-start;
    }

    body > .container > main {
        min-height: 0;
        padding-bottom: 0 !important;
    }

    .auth-page {
        display: block !important;
        max-width: none !important;
        min-height: 0 !important;
        padding: 12px 10px calc(122px + env(safe-area-inset-bottom)) !important;
    }

    .auth-page > .row {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
    }

    .auth-page > .row > [class*="col-"] {
        padding-right: 0;
        padding-left: 0;
    }

    .auth-card {
        border-radius: 22px !important;
        padding: 22px !important;
    }

    .logo-img {
        max-width: 82px;
    }

    .auth-card-heading h1 {
        font-size: 25px;
    }

    .auth-brand {
        margin-bottom: 14px !important;
    }

    .auth-brand-link {
        gap: 8px;
    }

    .auth-brand-link span {
        padding: 7px 13px;
        font-size: 13px;
    }

    .auth-tabs {
        margin-bottom: 18px !important;
    }

    .form-control {
        min-height: 46px;
        border-radius: 14px;
    }

    .auth-card img[id$="CaptchaImage"] {
        max-width: min(46vw, 150px);
        object-fit: cover;
    }

    .auth-card .d-flex.align-items-center.gap-2 {
        flex-wrap: wrap;
    }

    .auth-card .btn-sm {
        min-height: 38px;
        border-radius: 10px;
    }
}

@media (max-height: 760px) and (max-width: 576px) {
    .auth-page {
        padding-top: 8px;
    }

    .auth-card-heading {
        margin-bottom: 14px;
    }

    .auth-card-heading h1 {
        margin-top: 10px;
        font-size: 23px;
    }

    .auth-card-heading p {
        line-height: 1.7;
    }
}
