/* Minimal, premium chat widget to match site style */
.chat-widget {
    position: fixed;
    right: 22px;
    bottom: 84px;
    z-index: 60;
    font-family: Manrope, "Segoe UI", sans-serif;
    color: var(--text, #d9e1f0);
}

.chat-fab-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
}

.chat-fab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(17, 24, 39, 0.82);
    color: var(--text, #d9e1f0);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.chat-fab span {
    color: var(--accent-text, #9ebaf0);
}

.chat-fab .logo-word {
    display: inline-flex;
    align-items: center;
    gap: 0;
    letter-spacing: 0;
}

.chat-fab .chat-label {
    color: var(--text, #d9e1f0);
}

.chat-fab.secondary {
    padding: 10px 14px;
    font-weight: 700;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(17, 24, 39, 0.7);
    color: #dfe7f6;
}

.chat-fab .logo-part {
    color: var(--text, #d9e1f0);
}

.chat-fab .logo-part.accent {
    color: var(--accent-text, #9ebaf0);
}

.chat-panel {
    position: absolute;
    right: 0;
    bottom: 56px;
    width: 420px;
    height: 640px;
    max-height: 72vh;
    display: none;
    flex-direction: column;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(13, 19, 33, 0.96), rgba(10, 16, 30, 0.96));
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    backdrop-filter: blur(16px);
    position: absolute;
}

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

.chat-header {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.chat-title {
    font-weight: 800;
    letter-spacing: -0.01em;
}

.chat-status {
    font-size: 12px;
    color: var(--accent-text, #9ebaf0);
}

.chat-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.chat-lead-btn {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(126, 168, 244, 0.18);
    color: #e8eefc;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 10px;
    cursor: pointer;
}

.chat-messages {
    padding: 16px 18px;
    overflow: auto;
    display: grid;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.chat-msg {
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.chat-msg.user {
    background: rgba(126, 168, 244, 0.12);
    border: 1px solid rgba(126, 168, 244, 0.2);
    justify-self: end;
}

.chat-msg.assistant {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    justify-self: start;
}

.chat-input {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.chat-input textarea {
    resize: none;
    min-height: 44px;
    max-height: 120px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text, #d9e1f0);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.chat-send {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(126, 168, 244, 0.26);
    background: rgba(126, 168, 244, 0.18);
    color: #eff4ff;
    font-weight: 700;
    cursor: pointer;
}

.chat-send[disabled] {
    opacity: 0.6;
    cursor: default;
}

.chat-hint {
    padding: 0 18px 12px;
    color: #91a2be;
    font-size: 12px;
}

.chat-lead {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(10, 16, 30, 0.98), rgba(6, 10, 20, 0.98));
    z-index: 2;
}

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

.chat-lead h4 {
    margin: 0;
    font-size: 16px;
    color: #e9f0ff;
}

.chat-lead label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-text, #9ebaf0);
}

.chat-lead input,
.chat-lead textarea {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #e6edf7;
    padding: 10px 12px;
    font-size: 14px;
}

.chat-lead textarea {
    resize: vertical;
    min-height: 110px;
}

.chat-lead-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.chat-lead-status {
    font-size: 12px;
    color: #9eb2d3;
}

.chat-lead-status[data-state="error"] {
    color: #f4a7a7;
}

@media (max-width: 720px) {
    .chat-widget {
        right: 14px;
        bottom: 70px;
    }
    .chat-panel {
        width: min(92vw, 420px);
        right: -8px;
        height: min(70vh, 620px);
    }
}
