:root {
    --primary: #065ce9;
    --primary-dark: #0139a6;
    --primary-soft: #e7f0ff;

    --bg-main: #ffffff;
    --bg-muted: #f8f9fe;
    --bg-footer: #323538;

    --border-soft: #e1e4ea;

    --text-main: #404042;
    --text-muted: #6f7684;
    --text-inverse: #ffffff;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);

    --container-width: 1280px;
    --container-padding: 24px;

    --font-ui: "Lato", sans-serif;
}

/* ========== Chat Widget ========== */

.chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 999;
    display: none;
    backdrop-filter: blur(2px);
}

.chat-overlay.chat-overlay--visible {
    display: block;
}

.chat-widget {
    position: fixed;
    right: 24px;
    bottom: 100px;
    width: 400px;
    height: 532px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 48px rgba(15, 23, 42, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.chat-widget.chat-widget--open {
    display: flex;
}

.chat-widget__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--primary);
    color: #ffffff;
}

.chat-widget__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.chat-widget__header-info {
    flex: 1;
    min-width: 0;
}

.chat-widget__title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 14px;
    letter-spacing: -0.15;
    color: #ffffff;
    margin-bottom: 4px;
}

.chat-widget__subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

.chat-widget__status {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.chat-widget__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

.chat-widget__close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.chat-widget__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-widget__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    background: #ffffff;
    min-height: 200px;
    max-height: 400px;
}

.chat-widget__message {
    margin-bottom: 16px;
    width: 279px;
}

.chat-widget__message-text {
    background: #ffffff;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    line-height: 140%;
    letter-spacing: -0.31px;
    line-height: 1.5;
    color: var(--text-main);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    margin-bottom: 4px;
}

.chat-widget__message-time {
    font-size: 11px;
    color: var(--text-muted);
    padding-left: 4px;
}

.chat-widget__message--user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
}

.chat-widget__message--user .chat-widget__message-text {
    background: var(--primary-soft);
    margin-left: auto;
    max-width: 80%;
}

.chat-widget__message--user .chat-widget__message-time {
    text-align: right;
    padding-right: 4px;
    padding-left: 0;
}

.chat-widget__input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: #ffffff;
}

.chat-widget__input {
    flex: 1;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-main);
    background: #ffffff;
}

.chat-widget__input:focus {
    outline: none;
    border-color: var(--primary);
}

.chat-widget__input::placeholder {
    color: var(--text-muted);
}

.chat-widget__send {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s;
    padding: 0;
}

.chat-widget__send img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.chat-widget__send:hover {
    background: var(--primary-dark);
}

.chat-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(43, 99, 255, 0.3);
    cursor: pointer;
    z-index: 999;
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(43, 99, 255, 0.4);
}

.chat-fab__icon {
    font-size: 18px;
}

.chat-fab.chat-fab--hidden {
    display: none;
}

@media (max-width: 768px) {
    .chat-widget {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 80px;
        max-height: calc(100vh - 100px);
    }

    .chat-fab {
        right: 12px;
        bottom: 12px;
        padding: 10px 16px;
    }

    .chat-fab__text {
        display: none;
    }
}
