
:root {
    color-scheme: dark;
    --bg: #090c12;
    --surface: #101722;
    --surface-light: #182332;
    --border: rgba(105, 190, 220, 0.14);
    --text: #e8f1f7;
    --muted: #8295a5;
    --accent: #55d8f2;
    --accent-glow: rgba(85, 216, 242, 0.2);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 0%, #14283a 0%, transparent 50%),
        var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", sans-serif;
}

.app {
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 28px;
}

.header {
    height: 82px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.logo {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border: 1px solid var(--accent);
    border-radius: 12px;
    color: var(--accent);
    font-size: 24px;
    font-weight: 300;
    box-shadow: 0 0 18px var(--accent-glow);
}

.brand h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 1px;
}

.brand span {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 2.5px;
}

.status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 1.5px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #54e5a3;
    box-shadow: 0 0 10px #54e5a3;
}

.chat {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.welcome {
    margin: auto;
    text-align: center;
    padding: 30px 0;
}

.welcome-orb {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    margin: 0 auto 28px;
    border: 1px solid rgba(85, 216, 242, 0.6);
    border-radius: 50%;
    color: var(--accent);
    font-size: 40px;
    font-weight: 200;
    box-shadow:
        0 0 25px var(--accent-glow),
        inset 0 0 25px var(--accent-glow);
}

.welcome h2 {
    font-size: 27px;
    font-weight: 400;
    margin: 0 0 10px;
}

.welcome p {
    color: var(--muted);
    font-size: 14px;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 30px 0;
}

.message {
    max-width: 78%;
    padding: 15px 18px;
    border-radius: 14px;
    line-height: 1.6;
    font-size: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message.user {
    align-self: flex-end;
    background: var(--surface-light);
    border: 1px solid var(--border);
}

.message.assistant {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
}

.message-label {
    display: block;
    margin-bottom: 7px;
    color: var(--accent);
    font-size: 10px;
    letter-spacing: 1.5px;
}

.composer {
    flex-shrink: 0;
    padding: 20px 0 16px;
    border-top: 1px solid var(--border);
}

#chat-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: border-color 0.2s;
}

#chat-form:focus-within {
    border-color: rgba(85, 216, 242, 0.55);
}

textarea {
    flex: 1;
    min-width: 0;
    max-height: 150px;
    resize: none;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    padding: 8px;
}

textarea::placeholder {
    color: #718394;
}

#send-button {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #071117;
    font-size: 24px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

#send-button:hover {
    transform: translateY(-2px);
}

#send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.footer-note {
    padding-top: 13px;
    text-align: center;
    color: #536575;
    font-size: 9px;
    letter-spacing: 2px;
}

.login-screen {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(ellipse at 50% 35%, #14283a 0%, transparent 55%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 40px 32px;
    text-align: center;
    background: rgba(16, 23, 34, 0.85);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
}

.login-card .welcome-orb {
    margin-bottom: 20px;
}

.login-card h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 400;
}

.login-card > p {
    margin: 8px 0 32px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 3px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

#login-form label {
    color: var(--muted);
    font-size: 12px;
}

#password-input {
    width: 100%;
    padding: 15px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    font-size: 14px;
}

#password-input:focus {
    border-color: var(--accent);
}

#login-button {
    padding: 14px;
    margin-top: 5px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #071117;
    font-weight: 600;
    cursor: pointer;
}

#login-button:disabled {
    opacity: 0.5;
    cursor: wait;
}

.login-error {
    min-height: 18px;
    color: #ff7777;
    font-size: 12px;
    text-align: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logout-button {
    padding: 8px 12px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.logout-button:hover {
    color: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 600px) {
    .app {
        padding: 0 15px;
    }

    .header {
        height: 70px;
    }

    .message {
        max-width: 92%;
    }

    .welcome h2 {
        font-size: 23px;
    }

    .header-actions {
        gap: 10px;
    }

    .logout-button {
        padding: 7px 9px;
        font-size: 11px;
    }
}
