:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0b100e;
    color: #edf5f0;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 12% 8%, rgba(72, 187, 120, 0.09), transparent 30rem),
        linear-gradient(145deg, #0d1310 0%, #090d0b 70%);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: 0.6;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid #71e39c;
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 430px);
    padding: 40px;
    border: 1px solid #26372d;
    border-radius: 18px;
    background: rgba(18, 26, 21, 0.96);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.brand-mark {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 24px;
    place-items: center;
    border: 1px solid #47765a;
    border-radius: 12px;
    background: linear-gradient(145deg, #2e7d4e, #1a4c30);
    box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.12);
    color: #fff;
    font-family: ui-monospace, "Cascadia Mono", monospace;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -1px;
}

.brand-mark.small {
    width: 44px;
    height: 44px;
    margin: 0;
    border-radius: 9px;
    font-size: 16px;
}

.eyebrow {
    margin: 0 0 7px;
    color: #72c995;
    font-family: ui-monospace, "Cascadia Mono", monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.7px;
}

h1,
h2,
p {
    margin-top: 0;
}

.login-card h1 {
    margin-bottom: 12px;
    font-size: 30px;
    letter-spacing: -0.8px;
}

.muted {
    margin-bottom: 30px;
    color: #a3b4aa;
    line-height: 1.6;
}

label {
    display: block;
    margin-bottom: 9px;
    color: #c7d4cc;
    font-size: 14px;
    font-weight: 600;
}

input {
    width: 100%;
    border: 1px solid #35483d;
    border-radius: 9px;
    background: #0c120e;
    color: #f2f8f4;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:hover {
    border-color: #4b6254;
}

input:focus {
    border-color: #65bd88;
    box-shadow: 0 0 0 3px rgba(80, 190, 125, 0.08);
}

#password {
    height: 48px;
    padding: 0 14px;
}

.primary-button,
.secondary-button {
    min-height: 42px;
    border-radius: 8px;
    font-weight: 700;
}

.primary-button {
    border: 1px solid #68cf91;
    background: #54bd7e;
    color: #07150d;
}

.primary-button:hover:not(:disabled) {
    background: #70d799;
}

#login-button {
    width: 100%;
    margin-top: 18px;
}

.secondary-button {
    padding: 0 16px;
    border: 1px solid #35473c;
    background: #17211b;
    color: #d7e3db;
}

.secondary-button:hover {
    border-color: #51665a;
    background: #1d2a22;
}

.form-error {
    margin: 14px 0 0;
    color: #ff9d9d;
    font-size: 14px;
    line-height: 1.5;
}

.security-note {
    margin: 28px 0 0;
    padding-top: 20px;
    border-top: 1px solid #28362d;
    color: #71847a;
    font-size: 12px;
    line-height: 1.6;
}

.console-shell {
    width: min(100% - 40px, 1440px);
    margin: 0 auto;
    padding: 28px 0 36px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.brand,
.header-actions {
    display: flex;
    align-items: center;
}

.brand {
    gap: 15px;
}

.brand .eyebrow {
    margin-bottom: 3px;
}

.brand h1 {
    margin: 0;
    font-size: 21px;
    letter-spacing: -0.4px;
}

.header-actions {
    gap: 16px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #34463b;
    border-radius: 20px;
    background: #151e18;
    color: #b4c2b9;
    font-size: 13px;
    font-weight: 650;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #89958e;
}

.status-pill.online {
    border-color: #315e43;
    background: rgba(37, 100, 58, 0.15);
    color: #8ce3ad;
}

.status-pill.online .status-dot {
    background: #61d58d;
    box-shadow: 0 0 10px rgba(97, 213, 141, 0.45);
}

.status-pill.offline .status-dot {
    background: #dd8282;
}

.console-card {
    overflow: hidden;
    border: 1px solid #2b3a31;
    border-radius: 15px;
    background: #111813;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.console-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 21px 24px;
    border-bottom: 1px solid #29372e;
}

.console-heading h2 {
    margin: 0;
    font-size: 18px;
}

.connection-state {
    color: #82968a;
    font-family: ui-monospace, "Cascadia Mono", monospace;
    font-size: 12px;
}

.connection-state.connected {
    color: #73cf97;
}

.connection-state.failed {
    color: #f09a9a;
}

.log {
    height: max(340px, calc(100vh - 330px));
    min-height: 340px;
    overflow-y: auto;
    padding: 18px 24px;
    background: #090e0b;
    scrollbar-color: #3b5143 #111813;
    scrollbar-width: thin;
    font-family: ui-monospace, "Cascadia Mono", "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.65;
}

.log-line {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    padding: 2px 0;
}

.log-time {
    color: #53675a;
    user-select: none;
}

.log-message {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    color: #c9d7ce;
}

.log-line.warning .log-message {
    color: #e7c981;
}

.log-line.error .log-message {
    color: #efa0a0;
}

.log-line.command .log-message {
    color: #83dea7;
}

.empty-state {
    padding: 24px 0;
    color: #607369;
    text-align: center;
}

.command-form {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 17px 20px;
    border-top: 1px solid #2a3a30;
    background: #121b15;
}

.prompt {
    color: #6de09a;
    font-family: ui-monospace, "Cascadia Mono", monospace;
    font-size: 27px;
    font-weight: 700;
}

#command {
    height: 44px;
    padding: 0 13px;
    font-family: ui-monospace, "Cascadia Mono", monospace;
    font-size: 14px;
}

#command-button {
    min-width: 92px;
    padding: 0 18px;
}

.console-footer {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 22px;
    border-top: 1px solid #25332a;
    color: #65796d;
    font-size: 11px;
}

.console-footer p {
    margin: 0;
}

code,
kbd {
    border: 1px solid #314238;
    border-radius: 4px;
    background: #18221b;
    color: #a4b7ab;
    font-family: ui-monospace, "Cascadia Mono", monospace;
    font-size: 11px;
}

code {
    padding: 1px 4px;
}

kbd {
    padding: 1px 5px;
}

.command-message {
    color: #8fc3a2;
    text-align: right;
}

.command-message.error {
    color: #f09a9a;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

noscript {
    display: block;
    padding: 30px;
    color: #ff9d9d;
    text-align: center;
}

@media (max-width: 700px) {
    .login-card {
        padding: 30px 24px;
    }

    .console-shell {
        width: min(100% - 24px, 1440px);
        padding-top: 18px;
    }

    .topbar {
        align-items: flex-start;
    }

    .brand .eyebrow,
    .status-pill {
        display: none;
    }

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

    .header-actions {
        gap: 8px;
    }

    .console-heading,
    .log {
        padding-right: 15px;
        padding-left: 15px;
    }

    .log {
        height: calc(100vh - 295px);
        min-height: 320px;
        font-size: 12px;
    }

    .log-line {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 7px;
    }

    .command-form {
        gap: 8px;
        padding: 13px 12px;
    }

    #command-button {
        min-width: 70px;
        padding: 0 12px;
    }

    .console-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
        padding: 10px 15px;
    }

    .command-message {
        text-align: left;
    }
}
