:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #17223b;
    background: #f4f7fb;
    --app-viewport-height: 100dvh;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

.login-page {
    display: grid;
    height: var(--app-viewport-height);
    min-height: var(--app-viewport-height);
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    place-items: center;
    overflow: auto;
    overscroll-behavior: contain;
}

.assistant-page {
    height: var(--app-viewport-height);
    min-height: var(--app-viewport-height);
    background: linear-gradient(145deg, #f4f7fb 0%, #e9effa 100%);
    overflow: hidden;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 0 40px;
    background: #fff;
    border-bottom: 1px solid #dce3ef;
}

.app-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-logo {
    display: block;
    width: 118px;
    height: auto;
}

.connection-status {
    display: inline-flex;
    align-items: center;
    color: #067647;
    font-size: 0.875rem;
    font-weight: 650;
}

.connection-status span {
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: #12b76a;
}

.logout-button {
    min-height: 36px;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid #aebbd0;
    background: #fff;
    color: #315cb4;
    font-size: 0.875rem;
    font-weight: 650;
}

.logout-button:hover:not(:disabled) {
    border-color: #315cb4;
    background: #f4f7fb;
}

.assistant-shell {
    display: grid;
    min-height: calc(var(--app-viewport-height) - 56px);
    grid-template-columns: 1fr 1fr;
}

.assistant-context {
    align-self: center;
    max-width: 520px;
    padding: 48px;
}

.assistant-context h1 {
    margin: 4px 0 10px;
}

.assistant-context > p:not(.assistant-hint) {
    margin: 0;
    color: #53627d;
    line-height: 1.5;
}

.assistant-hint {
    margin: 28px 0 0;
    color: #71809b;
    font-size: 0.9rem;
}

.login-card {
    width: min(100%, 400px);
    max-height: calc(var(--app-viewport-height) - 32px);
    padding: 40px;
    background: #fff;
    border: 1px solid #dce3ef;
    border-radius: 16px;
    box-shadow: 0 14px 40px rgb(31 55 90 / 12%);
    overflow-y: auto;
}

.eyebrow {
    margin: 0 0 8px;
    color: #3757a6;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: 2rem;
}

.intro {
    margin: 10px 0 28px;
    color: #53627d;
    line-height: 1.5;
}

form {
    display: grid;
    gap: 9px;
}

label {
    font-size: 0.9rem;
    font-weight: 650;
}

input,
button {
    min-height: 44px;
    border-radius: 8px;
    font: inherit;
}

input {
    width: 100%;
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid #aebbd0;
    color: inherit;
}

input:focus {
    border-color: #315cb4;
    outline: 3px solid rgb(49 92 180 / 18%);
}

button {
    margin-top: 10px;
    border: 0;
    background: #315cb4;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

button:hover:not(:disabled) {
    background: #254a93;
}

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

.form-message {
    min-height: 1.25em;
    margin: 4px 0 0;
    color: #b42318;
    font-size: 0.9rem;
}

.form-message.success {
    color: #067647;
}

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

    .app-header {
        padding: 0 20px;
    }

    .brand-logo {
        width: 104px;
    }

    .connection-status {
        display: none;
    }
}

@media (max-width: 767px) {
    .assistant-shell {
        display: block;
        min-height: calc(var(--app-viewport-height) - 56px);
    }

    .assistant-context,
    .polybot-panel {
        display: none;
    }
}
