/* ==============================
   CHAT WIDGET — Gripsholms
   ============================== */

#chat-widget-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    cursor: pointer;
}

.chat-widget-circle {
    width: 58px;
    height: 58px;
    background: #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(26, 26, 26, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#chat-widget-btn:hover .chat-widget-circle {
    transform: scale(1.07);
    box-shadow: 0 6px 24px rgba(26, 26, 26, 0.6);
}

.chat-widget-bubble {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #5b2a86;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 700;
    font-family: -apple-system, sans-serif;
}

#chat-widget-panel {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    z-index: 9998;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    display: none;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

#chat-widget-panel.chat-open {
    display: block;
}

.chat-widget-header {
    background: #1a1a1a;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1;
}

.chat-widget-header-logo {
    color: white;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
}

.chat-widget-header-nav {
    display: flex;
    gap: 10px;
}

.chat-widget-header-nav button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.chat-widget-header-nav button:hover {
    color: white;
}

.chat-widget-broker {
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.chat-widget-broker-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-position: center 20%;
    background-size: cover;
    background-repeat: no-repeat;
    flex-shrink: 0;
    border: 2px solid #e8e8e8;
}

.chat-widget-broker-text {
    font-size: 13px;
    color: #444;
    line-height: 1.45;
}

.chat-widget-broker-text strong {
    display: block;
    color: #1a1a1a;
    font-size: 14px;
    margin-bottom: 2px;
}

.chat-widget-intro {
    padding: 14px 16px;
    font-size: 13px;
    color: #444;
    line-height: 1.5;
    border-bottom: 1px solid #f0f0f0;
}

.chat-widget-options {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-opt-btn {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    width: 100%;
    transition: opacity 0.15s;
    font-family: inherit;
}

.chat-opt-btn:hover { opacity: 0.88; }

.chat-opt-primary {
    background: #1a1a1a;
    color: white;
}

.chat-opt-secondary {
    background: white;
    color: #1a1a1a;
    border: 1px solid #d4d8dd;
}

.chat-widget-conv {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-user-bubble {
    background: #1a1a1a;
    color: white;
    padding: 8px 12px;
    border-radius: 14px 14px 2px 14px;
    font-size: 13px;
    align-self: flex-end;
    max-width: 80%;
    line-height: 1.4;
}

.chat-bot-row {
    display: flex;
    gap: 9px;
    align-items: flex-start;
}

.chat-bot-bubble {
    background: #f4f4f4;
    color: #333;
    padding: 8px 12px;
    border-radius: 2px 14px 14px 14px;
    font-size: 13px;
    max-width: 80%;
    line-height: 1.5;
}

.chat-widget-form {
    padding: 4px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-widget-form input,
.chat-widget-form textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.chat-widget-form input:focus,
.chat-widget-form textarea:focus {
    outline: none;
    border-color: #1a1a1a;
    background: white;
}

.chat-widget-form input.chat-error,
.chat-widget-form textarea.chat-error {
    border-color: #c0392b;
    background: #fff8f7;
}

.chat-widget-form textarea {
    resize: none;
    height: 72px;
}

.chat-gdpr-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.chat-gdpr-row input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
    flex-shrink: 0;
}

.chat-gdpr-row input.chat-error {
    outline: 2px solid #c0392b;
}

.chat-form-submit {
    background: #1a1a1a;
    color: white;
    padding: 11px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    border: none;
    width: 100%;
    transition: opacity 0.15s;
    font-family: inherit;
}

.chat-form-submit:hover { opacity: 0.88; }
.chat-form-submit:disabled { opacity: 0.6; cursor: default; }

.chat-form-sending {
    text-align: center;
    color: #888;
    font-size: 12px;
    padding: 4px 0;
    display: none;
}

.chat-widget-confirm {
    padding: 32px 16px;
    text-align: center;
}

.chat-widget-confirm-icon {
    font-size: 40px;
    margin-bottom: 12px;
    color: #5b2a86;
}

.chat-widget-confirm-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.chat-widget-confirm-sub {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}

@media (max-width: 400px) {
    #chat-widget-panel {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 90px;
    }
    #chat-widget-btn {
        right: 16px;
        bottom: 20px;
    }
}
