* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f7f8fa;
    color: #222831;
    font-family: Arial, Helvetica, sans-serif;
}

.auth-page {
    display: grid;
    width: 100%;
    height: 100dvh;
    min-height: 100vh;
    grid-template-rows: minmax(0, 1fr) 78px;
    overflow: hidden;
    background: #ffffff;
}

.auth-stage {
    position: relative;
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0, 48%) minmax(0, 52%);
    overflow: hidden;
}

.auth-left {
    position: relative;
    z-index: 3;
    display: flex;
    min-width: 0;
    align-items: stretch;
    padding: 44px clamp(38px, 4.2vw, 72px) 26px;
    background: #ffffff;
}

.auth-left-inner {
    display: flex;
    width: 100%;
    min-height: 0;
    flex-direction: column;
}

.auth-logo {
    display: block;
    width: auto;
    max-width: 330px;
    height: 62px;
    object-fit: contain;
    object-position: left center;
}

.auth-login-cluster {
    width: min(100%, 520px);
    margin: auto;
}

.auth-product {
    margin: 0;
    color: #2d333c;
    font-size: clamp(2.35rem, 3.2vw, 3.35rem);
    font-weight: 400;
    letter-spacing: -0.045em;
    line-height: 1;
}

.auth-product strong {
    color: #dc2229;
    font-weight: 800;
}

.auth-blue-line {
    width: 120px;
    height: 4px;
    margin: 18px 0 18px 88px;
    border-radius: 99px;
    background: #2f80d8;
}

.auth-tagline {
    margin: 0 0 26px;
    color: #626d79;
    font-size: 1rem;
}

.login-card,
.auth-card {
    width: 100%;
    max-width: 510px;
    padding: 28px 30px;
    border: 1px solid #e1e5ea;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.055);
}

.login-card h1,
.auth-card h1 {
    margin: 0 0 7px;
    font-size: 1.38rem;
    line-height: 1.2;
}

.login-lead,
.auth-card .lead {
    margin: 0 0 25px;
    color: #7a8490;
    font-size: 0.86rem;
    line-height: 1.5;
}

.auth-form label,
.auth-card label {
    display: block;
    margin: 0 0 7px;
    font-size: 0.84rem;
    font-weight: 800;
}

.auth-form input,
.auth-card input {
    width: 100%;
    min-height: 46px;
    margin: 0 0 17px;
    padding: 11px 13px;
    border: 1px solid #d5dbe3;
    border-radius: 9px;
    background: #ffffff;
    color: #222831;
    font-size: 0.94rem;
}

.auth-form input:focus,
.auth-card input:focus {
    border-color: #6da4df;
    outline: 3px solid rgba(49, 132, 216, 0.13);
}

.auth-submit,
.primary-button {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 0;
    border-radius: 9px;
    background: #e31f26;
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 9px 22px rgba(224, 36, 36, 0.14);
}

.auth-submit:hover,
.primary-button:hover {
    background: #c91920;
}

.password-help {
    margin: -6px 0 18px;
    text-align: right;
}

.password-help a,
.back-link {
    color: #1669c4;
    font-weight: 700;
    text-decoration: none;
}

.password-help a:hover,
.back-link:hover {
    text-decoration: underline;
}

.error,
.errors {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 9px;
    background: #fff1f2;
    color: #991b1b;
}

.auth-language {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eceff3;
}

.auth-language span {
    margin-right: auto;
    color: #626d79;
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-language button {
    min-width: 46px;
    min-height: 36px;
    padding: 5px 10px;
    border: 1px solid #dfe3e9;
    border-radius: 8px;
    background: #ffffff;
    color: #525d6b;
    font-weight: 800;
    cursor: pointer;
}

.auth-language button.active {
    border-color: #d91f27;
    background: #e31b23;
    color: #ffffff;
}

.auth-hero {
    position: relative;
    z-index: 1;
    min-width: 0;
    margin-left: -4vw;
    overflow: hidden;
    clip-path: polygon(13% 0, 100% 0, 100% 100%, 0 100%);
    background: linear-gradient(145deg, #fafbfc 0%, #f0f3f7 100%);
}

.auth-hero::before {
    position: absolute;
    top: 12%;
    left: 19%;
    width: 230px;
    height: 135px;
    background-image: radial-gradient(circle, rgba(65, 75, 88, 0.10) 1.5px, transparent 1.7px);
    background-size: 12px 12px;
    content: "";
    opacity: 0.28;
}

.auth-hero::after {
    position: absolute;
    top: 4%;
    right: 2%;
    width: min(54vw, 760px);
    height: min(54vw, 760px);
    border: 68px solid rgba(44, 52, 63, 0.035);
    border-radius: 50%;
    content: "";
}

.auth-emblem {
    position: absolute;
    z-index: 0;
    top: 5%;
    right: -1%;
    width: min(37vw, 520px);
    max-height: 58%;
    object-fit: contain;
    opacity: 0.055;
    filter: grayscale(1) saturate(0);
    pointer-events: none;
}

.auth-machines {
    position: absolute;
    z-index: 2;
    right: 2.5%;
    bottom: 4%;
    display: block;
    width: min(87%, 980px);
    height: auto;
    max-height: 77%;
    object-fit: contain;
    object-position: right bottom;
}

.auth-footer {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    min-height: 78px;
    padding: 16px 34px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    color: #78828e;
    font-size: 0.75rem;
}

.auth-footer-author {
    justify-self: start;
}

.auth-footer-product {
    justify-self: center;
    color: #5d6875;
    font-weight: 800;
}

.auth-footer-right {
    justify-self: end;
    text-align: right;
}

.auth-shell-simple {
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: center;
    padding: 34px 20px;
    background: linear-gradient(145deg, #f9fafb 0%, #eef1f5 100%);
}

.auth-shell-simple .auth-card {
    max-width: 500px;
}

.auth-shell-brand {
    margin-bottom: 24px;
    text-align: center;
}

.auth-shell-brand .auth-logo {
    max-width: 280px;
    height: 52px;
    margin: 0 auto;
    object-position: center;
}

.auth-shell-brand .auth-product {
    margin-top: 20px;
    font-size: 1.8rem;
}

.auth-shell-brand .auth-blue-line {
    margin-left: auto;
    margin-right: auto;
}

@media (max-height: 820px) and (min-width: 981px) {
    .auth-page {
        grid-template-rows: minmax(0, 1fr) 58px;
    }

    .auth-left {
        padding-top: 18px;
        padding-bottom: 12px;
    }

    .auth-logo {
        max-width: 285px;
        height: 48px;
    }

    .auth-login-cluster {
        width: min(100%, 500px);
    }

    .auth-product {
        font-size: 2.25rem;
    }

    .auth-blue-line {
        width: 76px;
        height: 3px;
        margin-top: 12px;
        margin-bottom: 12px;
        margin-left: 64px;
    }

    .auth-tagline {
        margin-bottom: 18px;
        font-size: 0.9rem;
    }

    .login-card {
        max-width: 500px;
        padding: 20px 24px;
    }

    .login-card h1 {
        font-size: 1.2rem;
    }

    .login-lead {
        margin-bottom: 17px;
    }

    .auth-form input {
        min-height: 40px;
        margin-bottom: 12px;
    }

    .password-help {
        margin-bottom: 13px;
    }

    .auth-submit {
        min-height: 43px;
    }

    .auth-language {
        margin-top: 16px;
        padding-top: 13px;
    }

    .auth-language button {
        min-height: 32px;
    }

    .auth-machines {
        max-height: 79%;
    }

    .auth-footer {
        min-height: 64px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
}

@media (max-width: 980px) {
    .auth-page {
        height: auto;
        min-height: 100vh;
        grid-template-rows: minmax(0, 1fr) auto;
        overflow: visible;
    }

    .auth-stage {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .auth-hero {
        display: none;
    }

    .auth-left {
        min-height: calc(100vh - 92px);
        justify-content: center;
        padding: 42px 24px;
    }

    .auth-left-inner {
        width: min(100%, 620px);
    }

    .auth-login-cluster {
        width: 100%;
        margin-top: 34px;
    }

    .auth-logo {
        max-width: 280px;
        height: 52px;
    }

    .login-card {
        max-width: 620px;
    }

    .auth-footer {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 14px 20px;
        text-align: center;
    }

    .auth-footer-author,
    .auth-footer-product,
    .auth-footer-right {
        justify-self: center;
        text-align: center;
    }
}

@media (max-width: 560px) {
    .auth-left {
        padding: 28px 16px;
    }

    .auth-logo {
        max-width: 240px;
        height: 46px;
    }

    .auth-product {
        margin-top: 30px;
        font-size: 2.15rem;
    }

    .auth-blue-line {
        width: 70px;
        margin-left: 58px;
    }

    .login-card,
    .auth-card {
        padding: 22px 18px;
    }

    .auth-language {
        flex-wrap: wrap;
    }

    .auth-language span {
        width: 100%;
        margin-bottom: 4px;
    }
}
