:root {
    --kg-black: #0b0c0c;
    --kg-ink: #171a19;
    --kg-muted: #69716d;
    --kg-line: #dfe4e1;
    --kg-surface: #ffffff;
    --kg-canvas: #f2f4f3;
    --kg-green: #19a974;
    --kg-green-dark: #087a51;
    --kg-green-soft: #e6f7f0;
    --kg-danger: #b42318;
    --kg-danger-soft: #fff1f0;
}

* {
    box-sizing: border-box;
}

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

body.kg-login-page {
    min-height: 100dvh;
    margin: 0;
    color: var(--kg-ink);
    background: var(--kg-canvas);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
}

.kg-login-header {
    height: 68px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--kg-black);
    border-bottom: 1px solid #232725;
}

.kg-login-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.kg-login-brand:hover,
.kg-login-brand:focus {
    color: #fff;
    text-decoration: none;
}

.kg-login-brand strong,
.kg-login-brand small {
    display: block;
    letter-spacing: 0;
}

.kg-login-brand strong {
    font-size: 16px;
    line-height: 20px;
}

.kg-login-brand small {
    margin-top: 1px;
    color: #aeb5b1;
    font-size: 12px;
    line-height: 16px;
}

.kg-brand-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    border-radius: 7px;
    background: #fff;
    color: var(--kg-black);
    font-size: 15px;
    font-weight: 800;
}

.kg-brand-mark-small {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    background: var(--kg-black);
    color: #fff;
}

.kg-language-switch {
    display: inline-flex;
    padding: 3px;
    border: 1px solid #343936;
    border-radius: 7px;
    background: #171a19;
}

.kg-language-switch button {
    min-width: 52px;
    height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 5px;
    color: #aeb5b1;
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}

.kg-language-switch button.active {
    color: var(--kg-black);
    background: #fff;
}

.kg-login-stage {
    min-height: calc(100dvh - 68px);
    padding: 48px 24px;
    display: grid;
    place-items: center;
}

.kg-login-shell {
    width: min(1080px, 100%);
    min-height: 570px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(400px, .85fr);
    overflow: hidden;
    border: 1px solid var(--kg-line);
    border-radius: 8px;
    background: var(--kg-surface);
    box-shadow: 0 24px 70px rgba(25, 35, 30, .11);
}

.kg-platform-panel {
    padding: 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background: var(--kg-black);
}

.kg-console-label {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #28634d;
    border-radius: 5px;
    color: #78dcb7;
    background: #123628;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.kg-platform-panel h1 {
    max-width: 520px;
    margin: 28px 0 18px;
    color: #fff;
    font-size: 42px;
    line-height: 1.12;
    font-weight: 750;
    letter-spacing: 0;
}

.kg-platform-panel p {
    max-width: 530px;
    margin: 0;
    color: #b9c0bc;
    font-size: 16px;
    line-height: 1.65;
}

.kg-operation-scope {
    margin: 42px 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid #2c312e;
    border-bottom: 1px solid #2c312e;
}

.kg-operation-scope span {
    min-height: 94px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    border-right: 1px solid #2c312e;
}

.kg-operation-scope span:first-child {
    padding-left: 0;
}

.kg-operation-scope span:last-child {
    border-right: 0;
}

.kg-operation-scope i {
    color: #56d5a5;
    font-size: 18px;
}

.kg-operation-scope b {
    font-size: 13px;
    line-height: 18px;
}

.kg-access-note {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #8f9993;
    font-size: 13px;
}

.kg-auth-panel {
    padding: 58px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

.kg-auth-heading {
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.kg-auth-heading h2 {
    margin: 0 0 5px;
    color: var(--kg-ink);
    font-size: 25px;
    line-height: 32px;
    font-weight: 750;
    letter-spacing: 0;
}

.kg-auth-heading p {
    margin: 0;
    color: var(--kg-muted);
    font-size: 14px;
    line-height: 20px;
}

.kg-field {
    margin-bottom: 20px;
}

.kg-field label {
    display: block;
    margin: 0 0 8px;
    color: #303633;
    font-size: 13px;
    font-weight: 700;
}

.kg-input-wrap {
    position: relative;
}

.kg-input-wrap > i {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 1;
    color: #7b8580;
    transform: translateY(-50%);
}

.kg-login-page .form-control {
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #cfd6d2;
    border-radius: 6px;
    background: #fff;
    color: var(--kg-ink);
    box-shadow: none;
    font-size: 15px;
}

.kg-input-wrap .form-control {
    padding-left: 42px;
}

.kg-login-page .form-control:focus {
    border-color: var(--kg-green-dark);
    box-shadow: 0 0 0 3px rgba(25, 169, 116, .14);
}

.kg-login-page .form-control::placeholder {
    color: #89928d;
}

.kg-field label.error {
    margin: 7px 0 0;
    color: var(--kg-danger);
    font-size: 12px;
    font-weight: 600;
}

.kg-captcha {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 126px;
    gap: 12px;
    align-items: end;
}

.kg-captcha-image {
    height: 48px;
    margin-bottom: 20px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #cfd6d2;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.kg-captcha-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-form-options {
    min-height: 28px;
    margin: 0 0 18px;
    display: flex;
    align-items: center;
}

.kg-remember {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: #4f5853;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.kg-remember input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--kg-green-dark);
}

.kg-submit {
    width: 100%;
    height: 48px;
    border: 1px solid var(--kg-black);
    border-radius: 6px;
    color: #fff;
    background: var(--kg-black);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease, opacity .16s ease;
}

.kg-submit:hover,
.kg-submit:focus {
    color: #fff;
    background: #202522;
}

.kg-submit:active {
    transform: translateY(1px);
}

.kg-submit:disabled {
    cursor: wait;
    opacity: .66;
}

.kg-login-feedback {
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid #efb5b0;
    border-radius: 6px;
    color: var(--kg-danger);
    background: var(--kg-danger-soft);
    font-size: 13px;
    line-height: 20px;
}

.kg-security-hint {
    margin: 20px 0 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #747e78;
    font-size: 12px;
    line-height: 18px;
}

.kg-security-hint i {
    margin-top: 2px;
    color: var(--kg-green-dark);
}

@media (max-width: 900px) {
    .kg-login-stage {
        padding: 28px 18px;
    }

    .kg-login-shell {
        grid-template-columns: 1fr;
    }

    .kg-platform-panel {
        min-height: auto;
        padding: 34px;
    }

    .kg-platform-panel h1 {
        margin-top: 18px;
        font-size: 30px;
    }

    .kg-operation-scope {
        margin: 26px 0;
    }

    .kg-auth-panel {
        padding: 42px 34px;
    }
}

@media (max-width: 560px) {
    .kg-login-header {
        height: 62px;
        padding: 0 16px;
    }

    .kg-login-brand small {
        display: none;
    }

    .kg-language-switch button {
        min-width: 44px;
        padding: 0 8px;
    }

    .kg-login-stage {
        min-height: calc(100dvh - 62px);
        padding: 16px;
        place-items: start center;
    }

    .kg-login-shell {
        min-height: 0;
    }

    .kg-platform-panel {
        padding: 26px 24px;
    }

    .kg-platform-panel h1 {
        font-size: 22px;
        line-height: 1.3;
    }

    .kg-platform-panel p,
    .kg-operation-scope {
        display: none;
    }

    .kg-access-note {
        margin-top: 20px;
    }

    .kg-auth-panel {
        padding: 32px 24px;
    }

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

    .kg-captcha {
        grid-template-columns: 1fr;
    }

    .kg-captcha-image {
        width: 126px;
        margin-top: -12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kg-submit {
        transition: none;
    }
}
