:root {
    --auth-green-deep: #063b27;
    --auth-green: #08b957;
    --auth-green-bright: #35d86d;
    --auth-page: #f2f6f4;
    --auth-surface: #ffffff;
    --auth-text: #18231f;
    --auth-muted: #73817c;
    --auth-border: #dce6e1;
    --auth-input: #f7faf9;
    --auth-danger: #b42318;
    --auth-danger-bg: #fff1f0;
    --auth-radius: 24px;
    --auth-font: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    min-width: 320px;
    background: var(--auth-page);
    color: var(--auth-text);
    font-family: var(--auth-font);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

.auth-page {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 48px);
    overflow-x: hidden;
}

.auth-stage {
    width: min(1180px, 100%);
    min-height: min(720px, calc(100svh - 32px));
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
    overflow: hidden;
    border: 1px solid rgba(200, 215, 207, 0.92);
    border-radius: var(--auth-radius);
    background: var(--auth-surface);
}

.auth-brand {
    position: relative;
    min-height: 620px;
    padding: clamp(28px, 4vw, 52px);
    overflow: hidden;
    isolation: isolate;
    background: var(--auth-green-deep);
}

.auth-brand__art,
.auth-brand::before,
.auth-brand::after {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
}

.auth-brand__art {
    z-index: 0;
    background: url("login-brand-art.png") center / cover no-repeat;
    opacity: 0.96;
    transform: scale(1.04);
    animation: auth-art-drift 18s ease-in-out infinite alternate;
}

.auth-brand::before {
    z-index: 1;
    background: linear-gradient(132deg, rgba(2, 44, 29, 0.74), rgba(4, 112, 57, 0.1) 50%, rgba(0, 24, 16, 0.42));
}

.auth-brand::after {
    z-index: 1;
    background: radial-gradient(circle at 78% 20%, rgba(126, 255, 139, 0.28), transparent 34%);
    mix-blend-mode: screen;
    animation: auth-light-drift 15s ease-in-out infinite alternate;
}

.auth-brand__logo {
    position: relative;
    z-index: 2;
    display: block;
    width: min(240px, 54%);
    height: auto;
    max-height: 100px;
    object-fit: contain;
    object-position: left top;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(30px, 6vw, 76px);
    background: var(--auth-surface);
}

.auth-card {
    width: min(100%, 430px);
}

.auth-intro {
    margin-bottom: 30px;
}

.auth-intro h1 {
    margin: 0;
    color: var(--auth-text);
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.15;
}

.auth-intro > p:last-child {
    margin: 10px 0 0;
    color: var(--auth-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.auth-alert {
    display: grid;
    gap: 4px;
    margin: 0 0 20px;
    padding: 13px 15px;
    border: 1px solid #f2b8b5;
    border-radius: 10px;
    background: var(--auth-danger-bg);
    color: var(--auth-danger);
    font-size: 0.78rem;
    line-height: 1.45;
}

.auth-alert strong {
    font-size: 0.8rem;
}

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

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field label {
    color: var(--auth-text);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.auth-control {
    width: 100%;
    min-height: 50px;
    padding: 0 15px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    outline: none;
    background: var(--auth-input);
    color: var(--auth-text);
    font-size: 0.92rem;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.auth-control::placeholder {
    color: #9aa9a3;
}

.auth-control:focus {
    border-color: var(--auth-green);
    background: var(--auth-surface);
    box-shadow: 0 0 0 3px rgba(8, 185, 87, 0.12);
}

.password-field {
    position: relative;
}

.password-field .auth-control {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    color: var(--auth-green);
}

.password-toggle__icon {
    width: 18px;
    height: 18px;
}

.password-toggle__icon--visible {
    display: none;
}

.password-toggle[data-visible="true"] .password-toggle__icon--hidden {
    display: none;
}

.password-toggle[data-visible="true"] .password-toggle__icon--visible {
    display: block;
}

.auth-submit {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 4px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(110deg, var(--auth-green), var(--auth-green-bright));
    color: #ffffff;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    transition: background 160ms ease;
}

.auth-submit:hover {
    background: linear-gradient(110deg, #0ab353, #2fcf67);
}

.auth-submit:focus-visible,
.password-toggle:focus-visible {
    outline: 3px solid rgba(8, 185, 87, 0.26);
    outline-offset: 3px;
}

.auth-submit__arrow {
    font-size: 1.15rem;
    line-height: 1;
}

.auth-support {
    margin: 30px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--auth-border);
    color: var(--auth-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    text-align: center;
}

.auth-support strong {
    color: var(--auth-green);
    font-weight: 700;
}

html[data-theme="dark"] {
    --auth-page: #111714;
    --auth-surface: #202622;
    --auth-text: #eff8f2;
    --auth-muted: #a6b7ad;
    --auth-border: #3b4a41;
    --auth-input: #18201b;
    --auth-danger: #ffb8b3;
    --auth-danger-bg: #3b211f;
}

html[data-theme="dark"] .auth-stage {
    border-color: #35433a;
}

@keyframes auth-art-drift {
    from { transform: scale(1.04) translate3d(-1%, -1%, 0); }
    to { transform: scale(1.09) translate3d(1%, 1%, 0); }
}

@keyframes auth-light-drift {
    from { transform: translate3d(-3%, 0, 0); opacity: 0.72; }
    to { transform: translate3d(4%, 2%, 0); opacity: 1; }
}

@media (max-width: 899px) {
    .auth-page {
        display: block;
        min-height: 100svh;
        padding: 0;
    }

    .auth-stage {
        display: block;
        min-height: 100svh;
        border: 0;
        border-radius: 0;
        background: var(--auth-page);
    }

    .auth-brand {
        min-height: 220px;
        padding: 28px 24px 76px;
    }

    .auth-brand__logo {
        position: absolute;
        top: 22px;
        left: 20px;
        width: min(158px, 48%);
        max-height: 64px;
        margin: 0;
        object-position: left top;
    }

    .auth-form-panel {
        position: relative;
        width: calc(100% - 32px);
        min-height: 0;
        margin: -48px 16px 0;
        padding: 28px 20px 32px;
        border: 1px solid var(--auth-border);
        border-radius: 22px;
    }

    .auth-intro {
        margin-bottom: 28px;
    }
}

@media (max-width: 420px) {
    .auth-brand {
        min-height: 194px;
        padding-bottom: 62px;
    }

    .auth-brand__logo {
        top: 18px;
        left: 17px;
        width: min(146px, 48%);
        max-height: 58px;
    }

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

    .auth-intro h1 {
        font-size: 1.5rem;
    }
}

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