:root {
    color-scheme: light;
    --surface: #f4f6f5;
    --panel: #ffffff;
    --sidebar: #202522;
    --text: #1d2420;
    --muted: #68716c;
    --line: #c9d1cc;
    --accent: #167a51;
    --accent-hover: #106642;
    --danger: #b43b37;
    --danger-soft: #fbeceb;
    --focus: rgba(22, 122, 81, 0.2);
    font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
    letter-spacing: 0;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(300px, 38%) minmax(0, 1fr);
    min-height: 100svh;
}

.brand-panel {
    display: flex;
    min-height: 100svh;
    flex-direction: column;
    padding: clamp(30px, 5vw, 68px);
    background: var(--sidebar);
    color: #f6f8f7;
}

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

.brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.brand span,
.instance-state {
    display: flex;
    flex-direction: column;
}

.brand strong {
    font-size: 18px;
}

.brand small {
    margin-top: 3px;
    color: #9ba49f;
    font-size: 12px;
}

.brand-context {
    max-width: 420px;
    margin: auto 0;
    padding: 80px 0;
}

.eyebrow {
    margin: 0 0 12px;
    color: #56c18c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.brand-context h1 {
    margin: 0;
    font-size: clamp(38px, 5vw, 64px);
    line-height: 1.08;
}

.brand-context > p:last-child {
    max-width: 360px;
    margin: 18px 0 0;
    color: #b5bdb8;
    font-size: 15px;
    line-height: 1.7;
}

.instance-state {
    position: relative;
    padding: 22px 0 0 22px;
    border-top: 1px solid #38403c;
}

.instance-state > span {
    position: absolute;
    top: 29px;
    left: 1px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #56c18c;
    box-shadow: 0 0 0 4px rgba(86, 193, 140, 0.14);
}

.instance-state small {
    color: #9ba49f;
    font-size: 11px;
}

.instance-state strong {
    margin-top: 3px;
    font-size: 13px;
}

.login-workspace {
    display: grid;
    min-height: 100svh;
    padding: 36px;
    place-items: center;
}

.login-form-wrap {
    width: min(100%, 430px);
    animation: form-in 260ms ease-out both;
}

.login-form-wrap header {
    margin-bottom: 34px;
}

.login-form-wrap header .eyebrow {
    color: var(--accent);
}

.login-form-wrap h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
}

.login-form-wrap header > p:last-child {
    margin: 11px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 17px;
}

.field > span:first-child {
    color: #344039;
    font-size: 12px;
    font-weight: 700;
}

.input-icon {
    position: relative;
    display: block;
}

.input-icon > i {
    position: absolute;
    top: 15px;
    left: 14px;
    color: #8c9690;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--line);
    border-radius: 5px;
    outline: 0;
    background: var(--panel);
    color: var(--text);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.input-action input {
    padding-right: 46px;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus);
}

input.is-invalid {
    border-color: var(--danger);
}

input::placeholder {
    color: #9aa29d;
}

.input-action button {
    position: absolute;
    top: 5px;
    right: 5px;
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.input-action button:hover {
    background: var(--surface);
    color: var(--text);
}

.field-error {
    min-height: 15px;
    color: var(--danger);
    font-size: 11px;
}

.remember-option {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 2px 0 24px;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}

.remember-option input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
}

.login-button {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 5px;
    background: var(--accent);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 140ms ease, transform 140ms ease;
}

.login-button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.login-button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.login-button:focus-visible,
.input-action button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 22px;
    padding: 13px 14px;
    border-left: 3px solid var(--danger);
    background: var(--danger-soft);
    color: #7d2926;
    line-height: 1.5;
    animation: alert-in 180ms ease-out both;
}

.login-form-wrap footer {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #dce2de;
}

.login-form-wrap footer a {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
}

.login-form-wrap footer a:hover {
    color: var(--accent);
}

.is-hidden {
    display: none !important;
}

@keyframes form-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes alert-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        min-height: auto;
        padding: 22px 20px;
    }

    .brand-context {
        display: none;
    }

    .instance-state {
        display: none;
    }

    .login-workspace {
        min-height: calc(100svh - 90px);
        padding: 38px 20px 54px;
        place-items: start center;
    }
}

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