:root {
    --ink: #172126;
    --ink-soft: #34434a;
    --surface: #ffffff;
    --surface-muted: #f3f5f4;
    --line: #d8dfdc;
    --line-strong: #b9c5c1;
    --teal: #167d72;
    --teal-dark: #11645c;
    --teal-soft: #dcefeb;
    --coral: #e56b5d;
    --danger: #b42318;
    --white-muted: #c8d2d0;
}

* {
    box-sizing: border-box;
}

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

body.auth-body {
    margin: 0;
    color: var(--ink);
    background: var(--surface-muted);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    letter-spacing: 0;
}

.auth-main,
.login-shell {
    min-height: 100vh;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(360px, 0.92fr) minmax(440px, 1.08fr);
}

.login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    padding: 40px clamp(32px, 5vw, 72px) 28px;
    color: #ffffff;
    background: var(--ink);
}

.brand-lockup {
    z-index: 1;
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
}

.brand-lockup:hover,
.brand-lockup:focus-visible {
    color: #ffffff;
}

.brand-mark,
.mobile-brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #ffffff;
    background: var(--teal);
    border-radius: 6px;
    font-size: 15px;
    font-weight: 800;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
}

.brand-message {
    z-index: 1;
    max-width: 540px;
    margin: clamp(56px, 10vh, 96px) 0 38px;
}

.brand-kicker,
.login-eyebrow {
    margin: 0 0 12px;
    color: #64c5b8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.brand-message h1 {
    margin: 0;
    font-size: clamp(36px, 4vw, 56px);
    font-weight: 750;
    line-height: 1.12;
}

.brand-description {
    max-width: 520px;
    margin: 22px 0 0;
    color: var(--white-muted);
    font-size: 16px;
    line-height: 1.65;
}

.conversation-window {
    z-index: 1;
    width: min(100%, 510px);
    margin-top: auto;
    overflow: hidden;
    color: var(--ink);
    background: #eef2f1;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

.conversation-header {
    display: flex;
    align-items: center;
    min-height: 66px;
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.conversation-header > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.conversation-header strong,
.message-meta strong {
    font-size: 13px;
}

.conversation-header small,
.message-meta small {
    color: #73817d;
    font-size: 11px;
}

.conversation-avatar,
.message-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-right: 10px;
    color: #ffffff;
    background: var(--teal);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
}

.online-dot {
    width: 8px;
    height: 8px;
    margin-left: auto;
    background: #3ca66b;
    border-radius: 50%;
}

.conversation-body {
    min-height: 196px;
    padding: 18px 16px 12px;
}

.message-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
}

.message-row-own {
    justify-content: flex-end;
}

.message-row-own .message-content {
    align-items: flex-end;
}

.message-row-own .message-bubble {
    background: var(--teal-soft);
}

.message-avatar-coral {
    background: var(--coral);
}

.message-content {
    display: flex;
    max-width: 76%;
    flex-direction: column;
    gap: 5px;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-bubble {
    padding: 9px 11px;
    background: #ffffff;
    border: 1px solid #e3e8e6;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.45;
}

.message-status {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    color: #73817d;
    font-size: 10px;
}

.status-check {
    color: var(--teal);
    font-size: 12px;
    font-weight: 800;
}

.brand-footer {
    z-index: 1;
    margin: 22px 0 0;
    color: #8fa09c;
    font-size: 12px;
}

.login-panel {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 48px 32px;
    background: var(--surface-muted);
}

.login-card {
    width: min(100%, 430px);
    padding: 42px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(23, 33, 38, 0.08);
}

.login-header {
    margin-bottom: 30px;
}

.login-header h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 750;
    line-height: 1.2;
}

.login-header > p:last-child {
    margin: 10px 0 0;
    color: #687772;
    font-size: 14px;
    line-height: 1.55;
}

.login-eyebrow {
    color: var(--teal);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field-group {
    min-width: 0;
}

.form-label {
    margin-bottom: 8px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
}

.form-control {
    min-height: 46px;
    padding: 10px 13px;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-size: 14px;
}

.form-control::placeholder {
    color: #91a09b;
}

.form-control:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(22, 125, 114, 0.14);
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 64px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    min-width: 48px;
    padding: 5px 7px;
    color: var(--teal-dark);
    background: transparent;
    border: 0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    transform: translateY(-50%);
}

.password-toggle:hover {
    background: var(--teal-soft);
}

.password-toggle:focus-visible,
.login-button:focus-visible,
.brand-lockup:focus-visible {
    outline: 3px solid rgba(22, 125, 114, 0.28);
    outline-offset: 2px;
}

.field-validation,
.caps-lock-message {
    display: block;
    min-height: 18px;
    margin-top: 5px;
    color: var(--danger);
    font-size: 12px;
}

.caps-lock-message:empty {
    display: none;
}

.caps-lock-message:not(:empty) + .field-validation {
    margin-top: 0;
}

.input-validation-error {
    border-color: var(--danger);
}

.form-alert:empty,
.validation-summary-valid {
    display: none;
}

.form-alert {
    padding: 11px 13px;
    color: #7a271a;
    background: #fef3f2;
    border: 1px solid #fecdca;
    border-radius: 6px;
    font-size: 13px;
}

.form-alert.is-success {
  color: #17663d;
  background: #ecf8f1;
  border-color: #b7e1c8;
}

.form-alert ul {
    margin: 0;
    padding-left: 18px;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 13px;
}

.form-check-input {
    width: 17px;
    height: 17px;
    margin: 0;
    border-color: var(--line-strong);
    border-radius: 4px;
}

.form-check-input:checked {
    background-color: var(--teal);
    border-color: var(--teal);
}

.login-button {
    min-height: 46px;
    color: #ffffff;
    background: var(--teal);
    border: 1px solid var(--teal);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 750;
    transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.login-button:hover {
    background: var(--teal-dark);
    border-color: var(--teal-dark);
}

.login-button:active {
    transform: translateY(1px);
}

.support-note {
    margin: 26px 0 0;
    color: #76847f;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.access-denied {
    width: min(calc(100% - 32px), 500px);
    margin: min(12vh, 96px) auto 32px;
    padding: 42px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(23, 33, 38, 0.08);
    text-align: center;
}

.access-denied .brand-mark {
    margin: 0 auto 22px;
}

.access-denied h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 750;
}

.access-denied > p:not(.login-eyebrow) {
    margin: 12px 0 0;
    color: #687772;
    font-size: 14px;
    line-height: 1.55;
}

.access-denied-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
}

.access-denied-actions form {
    margin: 0;
}

.access-denied-primary,
.access-denied-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.access-denied-primary {
    color: #ffffff;
    background: var(--teal);
    border: 1px solid var(--teal);
}

.access-denied-primary:hover {
    color: #ffffff;
    background: var(--teal-dark);
}

.access-denied-secondary {
    color: var(--teal-dark);
    background: #ffffff;
    border: 1px solid var(--line-strong);
}

.access-denied-secondary:hover {
    background: var(--teal-soft);
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: minmax(300px, 0.8fr) minmax(420px, 1.2fr);
    }

    .brand-message h1 {
        font-size: 38px;
    }

    .conversation-window {
        display: none;
    }

    .brand-footer {
        margin-top: auto;
    }
}

@media (max-width: 720px) {
    .login-shell {
        display: block;
        min-height: 100vh;
        background: var(--surface-muted);
    }

    .login-brand {
        min-height: 0;
        padding: 22px 24px 54px;
    }

    .login-brand::after,
    .brand-message,
    .brand-footer {
        display: none;
    }

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

    .login-panel {
        min-height: 0;
        margin-top: -28px;
        padding: 0 16px 32px;
        background: transparent;
    }

    .login-card {
        width: min(100%, 470px);
        padding: 30px 24px;
    }
}

@media (max-width: 380px) {
    .login-brand {
        padding-right: 18px;
        padding-left: 18px;
    }

    .login-panel {
        padding-right: 10px;
        padding-left: 10px;
    }

    .login-card {
        padding-right: 18px;
        padding-left: 18px;
    }

    .login-header h2 {
        font-size: 27px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* BQ WorkHub UI Theme v1.0 - login screen aligned with the green pastel workspace. */
:root {
    --ink: #18231f;
    --ink-soft: #46534d;
    --surface: #ffffff;
    --surface-muted: #f5faf7;
    --line: #e2e9e5;
    --line-strong: #ced9d3;
    --teal: #15945f;
    --teal-dark: #087447;
    --teal-soft: #e4f5ec;
    --coral: #e96359;
    --white-muted: #6f7d76;
}

body.auth-body {
    background: #f7faf8;
    font-family: "Segoe UI Variable Text", "Segoe UI", Inter, Arial, sans-serif;
}

.login-brand {
    color: var(--ink);
    background:
        radial-gradient(circle at 15% 12%, rgba(109, 211, 155, .22), transparent 30%),
        radial-gradient(circle at 90% 88%, rgba(189, 231, 207, .34), transparent 36%),
        linear-gradient(160deg, #f3faf6 0%, #eaf6ef 100%);
    border-right: 1px solid #dfe9e3;
}

.brand-lockup,
.brand-lockup:hover,
.brand-lockup:focus-visible {
    color: #152019;
}

.brand-mark,
.mobile-brand-mark {
    background: linear-gradient(145deg, #42c77b, #18a95d);
    border: 4px solid #dff4e7;
    border-radius: 12px;
    box-shadow: 0 7px 18px rgba(28, 162, 91, .17);
}

.brand-kicker,
.login-eyebrow {
    color: var(--teal-dark);
}

.brand-message h1 {
    color: #142019;
}

.brand-description {
    color: #63736a;
}

.conversation-window {
    background: rgba(255, 255, 255, .74);
    border-color: #dce7e1;
    box-shadow: 0 24px 60px rgba(39, 82, 61, .12);
}

.conversation-body {
    background: #f8fbf9;
}

.message-row-own .message-bubble {
    color: #145c3d;
    background: #e8f6ee;
    border: 1px solid #d4eadf;
}

.login-panel {
    background: #ffffff;
}

.login-card {
    border-color: #e1e9e4;
    box-shadow: 0 22px 55px rgba(38, 67, 52, .09);
}

.login-input:focus,
.form-control:focus {
    border-color: #88caa9;
    box-shadow: 0 0 0 3px rgba(21, 148, 95, .1);
}

.login-submit {
    background: linear-gradient(180deg, #22aa6c, #128c57);
    border-color: #128c57;
    box-shadow: 0 8px 18px rgba(23, 143, 86, .16);
}

.login-submit:hover {
    background: #087447;
    border-color: #087447;
}
