* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Login */
#login-view {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

#login-view h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    color: #f8fafc;
}

#login-view p {
    color: #94a3b8;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 0.375rem;
}

.form-group input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    color: #f8fafc;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus {
    border-color: #6366f1;
}

.btn-primary {
    width: 100%;
    padding: 0.625rem;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: #4f46e5;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#login-error {
    color: #f87171;
    font-size: 0.875rem;
    margin-top: 0.75rem;
    display: none;
}

/* Chat */
#chat-view {
    display: none;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.chat-header h1 {
    font-size: 1.125rem;
    color: #f8fafc;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#model-select {
    padding: 0.375rem 0.5rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.375rem;
    color: #e2e8f0;
    font-size: 0.8125rem;
    outline: none;
}

#model-select:focus {
    border-color: #6366f1;
}

#btn-logout {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid #475569;
    border-radius: 0.375rem;
    color: #94a3b8;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s;
}

#btn-logout:hover {
    border-color: #f87171;
    color: #f87171;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background: #6366f1;
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.message.assistant {
    align-self: flex-start;
    background: #1e293b;
    color: #e2e8f0;
    border-bottom-left-radius: 0.25rem;
}

.message.error {
    align-self: center;
    background: #7f1d1d;
    color: #fca5a5;
    font-size: 0.875rem;
}

.message.thinking {
    align-self: flex-start;
    background: #1e293b;
    color: #64748b;
    font-style: italic;
}

.chat-input-area {
    padding: 0.75rem 1.25rem;
    background: #1e293b;
    border-top: 1px solid #334155;
    display: flex;
    gap: 0.5rem;
}

#chat-input {
    flex: 1;
    padding: 0.625rem 0.75rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    color: #f8fafc;
    font-size: 0.9375rem;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 42px;
    max-height: 120px;
}

#chat-input:focus {
    border-color: #6366f1;
}

#btn-send {
    padding: 0.625rem 1.25rem;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

#btn-send:hover {
    background: #4f46e5;
}

#btn-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* New password form */
#new-password-group {
    display: none;
}
