:root {
    --background: #f5f7fb;
    --surface: #ffffff;
    --text-primary: #10182f;
    --text-secondary: #62708c;
    --border: #dfe5f0;
    --primary: #315cf4;
    --primary-dark: #2449d8;
    --purple: #7437f5;
    --danger: #c83232;
    --danger-background: #fff1f1;
    --success: #087d5c;
    --success-background: #ebfff8;
    --shadow: 0 24px 70px rgba(20, 35, 80, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--background);
    color: var(--text-primary);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 0.95fr) minmax(480px, 1.05fr);
}

.auth-brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    min-height: 100vh;
    padding: 56px;
    background:
        radial-gradient(
            circle at 20% 10%,
            rgba(255, 255, 255, 0.16),
            transparent 32%
        ),
        linear-gradient(
            145deg,
            #204de5 0%,
            #4a49ee 48%,
            #7437f5 100%
        );
    color: #ffffff;
}

.auth-brand-panel::after {
    content: "";
    position: absolute;
    right: -180px;
    bottom: -180px;
    width: 520px;
    height: 520px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    box-shadow:
        0 0 0 70px rgba(255, 255, 255, 0.04),
        0 0 0 140px rgba(255, 255, 255, 0.03);
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
}

.brand,
.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    color: inherit;
    text-decoration: none;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.98);
    color: #4650ed;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 14px 35px rgba(13, 28, 93, 0.2);
}

.brand-name {
    font-size: 29px;
    line-height: 1;
    font-weight: 850;
    letter-spacing: -1px;
}

.brand-name span {
    color: #c7d4ff;
}

.brand-message {
    margin: auto 0 48px;
}

.brand-eyebrow,
.auth-eyebrow {
    display: block;
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-size: 13px;
    font-weight: 800;
}

.brand-eyebrow {
    color: rgba(255, 255, 255, 0.76);
}

.brand-message h1 {
    max-width: 650px;
    margin: 0;
    font-size: clamp(42px, 5vw, 68px);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.brand-message p {
    max-width: 590px;
    margin: 28px 0 0;
    color: rgba(255, 255, 255, 0.79);
    font-size: 19px;
    line-height: 1.75;
}

.brand-benefits {
    display: grid;
    gap: 16px;
}

.brand-benefit {
    display: flex;
    align-items: center;
    gap: 13px;
    color: rgba(255, 255, 255, 0.91);
    font-weight: 650;
}

.benefit-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px;
}

.auth-card {
    width: min(100%, 520px);
    padding: 50px;
    border: 1px solid rgba(218, 226, 239, 0.9);
    border-radius: 30px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.mobile-brand {
    display: none;
    margin-bottom: 42px;
    color: var(--text-primary);
}

.mobile-brand .brand-icon {
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--purple)
    );
    color: #ffffff;
}

.mobile-brand .brand-name span {
    color: var(--primary);
}

.auth-heading {
    margin-bottom: 34px;
}

.auth-eyebrow {
    margin-bottom: 13px;
    color: var(--primary);
}

.auth-heading h2 {
    margin: 0;
    font-size: 38px;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.auth-heading p {
    margin: 15px 0 0;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.65;
}

.auth-alert {
    margin-bottom: 24px;
    padding: 15px 17px;
    border: 1px solid #ffcaca;
    border-radius: 13px;
    background: var(--danger-background);
    color: var(--danger);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.5;
}

.auth-alert.success {
    border-color: #b9efdc;
    background: var(--success-background);
    color: var(--success);
}

.auth-form {
    display: grid;
    gap: 23px;
}

.form-field {
    display: grid;
    gap: 9px;
}

.form-field label {
    font-size: 14px;
    font-weight: 750;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.forgot-link {
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.form-field input {
    width: 100%;
    min-height: 55px;
    padding: 0 17px;
    border: 1px solid var(--border);
    border-radius: 13px;
    outline: none;
    background: #ffffff;
    color: var(--text-primary);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.form-field input::placeholder {
    color: #9aa6bb;
}

.form-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(49, 92, 244, 0.11);
}

.form-field input.invalid {
    border-color: #dc4848;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 90px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    padding: 6px 7px;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    transform: translateY(-50%);
}

.field-error {
    color: var(--danger);
    font-size: 13px;
    line-height: 1.4;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 57px;
    margin-top: 5px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(
        100deg,
        var(--primary),
        var(--purple)
    );
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(70, 74, 238, 0.22);
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        opacity 160ms ease;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 17px 34px rgba(70, 74, 238, 0.3);
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.67;
}

.button-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.auth-divider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 31px 0 23px;
    color: #99a5b9;
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    padding: 0 14px;
}

.auth-register,
.auth-security {
    text-align: center;
}

.auth-register {
    margin: 0;
    color: var(--text-secondary);
}

.auth-register a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.auth-register a:hover {
    text-decoration: underline;
}

.auth-security {
    max-width: 390px;
    margin: 29px auto 0;
    color: #98a4b8;
    font-size: 12px;
    line-height: 1.6;
}

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

@media (max-width: 960px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        padding: 28px;
    }

    .mobile-brand {
        display: inline-flex;
    }
}

@media (max-width: 560px) {
    .auth-form-panel {
        align-items: flex-start;
        padding: 18px;
    }

    .auth-card {
        padding: 32px 23px;
        border-radius: 23px;
    }

    .auth-heading h2 {
        font-size: 32px;
    }
}