:root {
    color-scheme: light;

    --font-family: "Inter", sans-serif;

    --bg: #f3f6fb;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --surface-muted: #f7f9fc;

    --text: #172033;
    --text-soft: #697386;
    --text-muted: #8a94a6;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.1);

    --success: #059669;
    --success-soft: rgba(5, 150, 105, 0.1);

    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.1);

    --border: rgba(23, 32, 51, 0.1);
    --border-strong: rgba(23, 32, 51, 0.16);

    --shadow:
        0 30px 80px rgba(30, 41, 59, 0.12),
        0 8px 24px rgba(30, 41, 59, 0.06);

    --presentation-bg: #0d1b35;
    --presentation-text: #ffffff;
    --presentation-soft: rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #090d14;
    --surface: rgba(17, 24, 39, 0.92);
    --surface-solid: #111827;
    --surface-muted: #151e2d;

    --text: #f1f5f9;
    --text-soft: #aab5c5;
    --text-muted: #7f8a9b;

    --primary: #4f8cff;
    --primary-dark: #3b75e6;
    --primary-soft: rgba(79, 140, 255, 0.13);

    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.1);

    --danger: #fb7185;
    --danger-soft: rgba(251, 113, 133, 0.1);

    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.15);

    --shadow:
        0 36px 100px rgba(0, 0, 0, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.2);

    --presentation-bg: #0b1220;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font-family);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

.auth-page {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
    min-height: 100vh;
    overflow: hidden;
}

.auth-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.background-shape {
    position: absolute;
    display: block;
    border-radius: 999px;
    filter: blur(10px);
}

.shape-one {
    top: -180px;
    right: -160px;
    width: 500px;
    height: 500px;
    background: rgba(37, 99, 235, 0.12);
}

.shape-two {
    bottom: -220px;
    left: 35%;
    width: 520px;
    height: 520px;
    background: rgba(59, 130, 246, 0.08);
}

.background-grid {
    position: absolute;
    inset: 0;
    opacity: 0.38;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(
        to bottom,
        transparent,
        black 20%,
        black 80%,
        transparent
    );
}

.auth-presentation {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 42px 48px 34px;
    color: var(--presentation-text);
    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(59, 130, 246, 0.28),
            transparent 34%
        ),
        radial-gradient(
            circle at 80% 75%,
            rgba(14, 165, 233, 0.12),
            transparent 30%
        ),
        linear-gradient(
            145deg,
            #102448 0%,
            var(--presentation-bg) 52%,
            #07101f 100%
        );
    overflow: hidden;
}

.auth-presentation::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.16;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.08) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.08) 1px,
            transparent 1px
        );
    background-size: 52px 52px;
    mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.8),
        transparent
    );
}

.auth-presentation::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -140px;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    box-shadow:
        0 0 0 50px rgba(255, 255, 255, 0.025),
        0 0 0 110px rgba(255, 255, 255, 0.018);
}

.presentation-header,
.presentation-content,
.presentation-footer {
    position: relative;
    z-index: 2;
}

.presentation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    color: inherit;
    text-decoration: none;
}

.brand-symbol {
    position: relative;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 15px;
    color: #ffffff;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.2),
            rgba(255, 255, 255, 0.06)
        );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 12px 28px rgba(0, 0, 0, 0.18);
}

.brand-symbol span {
    position: relative;
    z-index: 1;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.6px;
}

.brand-copy {
    display: grid;
    gap: 3px;
}

.brand-copy strong {
    font-size: 15px;
    font-weight: 700;
}

.brand-copy small {
    color: var(--presentation-soft);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.private-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.06);
    font-size: 11px;
    font-weight: 600;
}

.presentation-content {
    width: min(100%, 540px);
    margin: auto 0;
    padding: 70px 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 22px;
    padding: 8px 11px;
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 999px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.12);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.presentation-content h1 {
    max-width: 520px;
    margin: 0;
    font-size: clamp(42px, 5vw, 68px);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.presentation-content > p {
    max-width: 500px;
    margin: 25px 0 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 16px;
    line-height: 1.7;
}

.feature-list {
    display: grid;
    gap: 12px;
    max-width: 480px;
    margin-top: 36px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.055);
    backdrop-filter: blur(16px);
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 13px;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.14);
    font-size: 18px;
}

.feature div {
    display: grid;
    gap: 4px;
}

.feature strong {
    font-size: 13px;
}

.feature small {
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    line-height: 1.45;
}

.presentation-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
}

.presentation-footer span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.auth-main {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 52px 28px 28px;
}

.theme-toggle {
    position: absolute;
    top: 28px;
    right: 30px;
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-soft);
    background: var(--surface);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    color: var(--primary);
}

.theme-toggle i {
    font-size: 17px;
}

.theme-light-icon {
    display: none;
}

html[data-theme="dark"] .theme-dark-icon {
    display: none;
}

html[data-theme="dark"] .theme-light-icon {
    display: inline-block;
}

.login-card {
    width: min(100%, 470px);
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(28px);
}

.mobile-brand {
    display: none;
}

.login-heading {
    margin-bottom: 28px;
}

.login-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 20px;
    border-radius: 15px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 20px;
}

.heading-label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-heading h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.login-heading p {
    margin: 12px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.65;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
    padding: 14px;
    border: 1px solid transparent;
    border-radius: 15px;
    font-size: 12px;
}

.alert > i {
    margin-top: 1px;
    font-size: 16px;
}

.alert div {
    display: grid;
    gap: 4px;
}

.alert strong {
    font-size: 12px;
}

.alert span {
    line-height: 1.5;
}

.alert-error {
    border-color: rgba(220, 38, 38, 0.16);
    color: var(--danger);
    background: var(--danger-soft);
}

.alert-success {
    border-color: rgba(5, 150, 105, 0.16);
    color: var(--success);
    background: var(--success-soft);
}

.form-group {
    margin-bottom: 19px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.secure-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
}

.input-control {
    position: relative;
}

.input-control > i {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 2;
    color: var(--text-muted);
    font-size: 15px;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-control input {
    width: 100%;
    height: 54px;
    padding: 0 16px 0 46px;
    border: 1px solid var(--border);
    outline: none;
    border-radius: 15px;
    color: var(--text);
    background: var(--surface-muted);
    font-size: 13px;
    font-weight: 500;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.password-control input {
    padding-right: 52px;
}

.input-control input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.input-control input:hover {
    border-color: var(--border-strong);
}

.input-control input:focus {
    border-color: var(--primary);
    background: var(--surface-solid);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.input-control:focus-within > i {
    color: var(--primary);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 11px;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.login-button {
    position: relative;
    width: 100%;
    height: 55px;
    margin-top: 7px;
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.23);
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 38px rgba(37, 99, 235, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.button-content,
.button-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 800;
}

.button-loading {
    display: none;
}

.login-button.is-loading {
    cursor: wait;
    opacity: 0.88;
}

.login-button.is-loading .button-content {
    display: none;
}

.login-button.is-loading .button-loading {
    display: flex;
}

.button-loading i {
    animation: spin 0.8s linear infinite;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 23px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 10px;
}

.login-footer span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.login-footer a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.copyright {
    margin: 22px 0 0;
    color: var(--text-muted);
    font-size: 10px;
    text-align: center;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1050px) {
    .auth-page {
        grid-template-columns: minmax(360px, 0.8fr) minmax(480px, 1.2fr);
    }

    .auth-presentation {
        padding-inline: 34px;
    }

    .presentation-content h1 {
        font-size: 46px;
    }

    .private-badge {
        display: none;
    }
}

@media (max-width: 820px) {
    .auth-page {
        display: block;
        min-height: 100svh;
    }

    .auth-presentation {
        display: none;
    }

    .auth-main {
        min-height: 100svh;
        padding:
            max(78px, env(safe-area-inset-top))
            18px
            max(24px, env(safe-area-inset-bottom));
    }

    .theme-toggle {
        top: max(18px, env(safe-area-inset-top));
        right: 18px;
    }

    .login-card {
        padding: 30px;
        border-radius: 24px;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 30px;
        padding-bottom: 22px;
        border-bottom: 1px solid var(--border);
    }

    .mobile-brand .brand-symbol {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border: 0;
        color: #ffffff;
        background:
            linear-gradient(
                145deg,
                var(--primary),
                var(--primary-dark)
            );
        box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
    }

    .mobile-brand div {
        display: grid;
        gap: 3px;
    }

    .mobile-brand strong {
        font-size: 14px;
    }

    .mobile-brand small {
        color: var(--text-muted);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
}

@media (max-width: 480px) {
    .auth-main {
        justify-content: flex-start;
        padding-top: max(76px, env(safe-area-inset-top));
    }

    .login-card {
        padding: 25px 20px;
        border-radius: 22px;
    }

    .login-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 17px;
    }

    .login-heading h2 {
        font-size: 26px;
    }

    .input-control input {
        height: 52px;
        font-size: 16px;
    }

    .login-button {
        height: 53px;
    }

    .login-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}