#fg-quote-widget {
    --fg-red: #fa5959;
    --fg-red-dark: #e14646;
    --fg-blue: #2563eb;
    --fg-blue-dark: #1d4ed8;
    --fg-bubble-gray: #f0f0f2;
    --fg-text: #111111;
    --fg-text-light: #6b7280;
    --fg-border: #e2e2e7;
    --fg-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: fixed;
    right: 20px;
    bottom: 90px;
    z-index: 999999;
    font-family: var(--fg-font);
    font-size: 14px;
    line-height: 1.45;
    color: var(--fg-text);
}

#fg-quote-widget * {
    box-sizing: border-box;
}

#fg-quote-widget button {
    font-family: var(--fg-font);
    cursor: pointer;
}

.fg-launcher {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.fg-teaser {
    background: #ffffff;
    color: var(--fg-text);
    padding: 11px 18px;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(17, 17, 17, 0.04), 0 6px 16px rgba(17, 17, 17, 0.10);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    animation: fg-teaser-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.3s;
}

.fg-launcher-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--fg-red);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(250, 89, 89, 0.30), 0 8px 20px rgba(250, 89, 89, 0.35);
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    animation: fg-breathe 3.4s ease-in-out infinite;
}

.fg-launcher-btn:hover {
    background: var(--fg-red-dark);
    transform: scale(1.05);
}

.fg-launcher-btn:active {
    transform: scale(0.95);
}

.fg-launcher-btn svg {
    width: 24px;
    height: 24px;
}

.fg-launcher-btn .fg-icon-chat,
.fg-launcher-btn .fg-icon-close {
    position: absolute;
    transition: opacity 0.18s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fg-launcher-btn .fg-icon-close {
    opacity: 0;
    transform: rotate(-45deg) scale(0.6);
}

.fg-launcher-btn .fg-icon-chat {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

#fg-quote-widget.fg-open .fg-launcher-btn {
    animation: none;
}

#fg-quote-widget.fg-open .fg-launcher-btn .fg-icon-chat {
    opacity: 0;
    transform: rotate(45deg) scale(0.6);
}

#fg-quote-widget.fg-open .fg-launcher-btn .fg-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

#fg-quote-widget.fg-open .fg-teaser {
    display: none;
}

.fg-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 380px;
    max-height: 640px;
    height: 640px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 2px 4px rgba(17, 17, 17, 0.04), 0 12px 24px rgba(17, 17, 17, 0.08), 0 28px 56px rgba(17, 17, 17, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    opacity: 0;
    transform: translateY(14px) scale(0.94);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1), transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.22s;
}

#fg-quote-widget.fg-open .fg-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1), transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

.fg-panel.fg-compact {
    height: 420px;
}

.fg-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--fg-border);
    flex-shrink: 0;
}

.fg-panel-header button {
    background: none;
    border: none;
    color: var(--fg-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.fg-panel-header button:hover {
    background: #f4f4f6;
}

.fg-panel-header button:active {
    transform: scale(0.92);
}

.fg-panel-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--fg-text);
}

.fg-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: #d7d7dc transparent;
}

.fg-panel-body::-webkit-scrollbar {
    width: 6px;
}

.fg-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.fg-panel-body::-webkit-scrollbar-thumb {
    background: #d7d7dc;
    border-radius: 10px;
}

.fg-panel-body::-webkit-scrollbar-thumb:hover {
    background: #c2c2c9;
}

.fg-row {
    display: flex;
    width: 100%;
    animation: fg-fade-in-up 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fg-row.fg-row-end {
    justify-content: flex-end;
}

.fg-bubble {
    background: var(--fg-bubble-gray);
    color: var(--fg-text);
    padding: 12px 16px;
    border-radius: 14px;
    max-width: 90%;
}

.fg-bubble-user {
    background: var(--fg-red);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 20px;
    font-weight: 500;
}

.fg-bubble-error {
    background: #fdecec;
    color: #b42318;
}

.fg-success-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.fg-success-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e3f8ea;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fg-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: 0.05s;
}

.fg-success-icon svg {
    width: 20px;
    height: 20px;
}

.fg-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 15px 16px;
}

.fg-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a7abb3;
    animation: fg-typing-bounce 1.2s infinite ease-in-out both;
}

.fg-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.fg-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

.fg-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    animation: fg-fade-in-up 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fg-chip {
    background: #ffffff;
    border: 1.5px solid var(--fg-blue);
    color: var(--fg-blue);
    padding: 9px 16px;
    border-radius: 18px;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.15s ease;
}

.fg-chip:hover {
    background: #eef3ff;
}

.fg-chip:active {
    transform: scale(0.95);
}

.fg-form {
    background: var(--fg-bubble-gray);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fg-fade-in-up 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fg-form-intro {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--fg-text);
}

.fg-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#fg-quote-widget .fg-field input,
#fg-quote-widget .fg-field textarea {
    border: 1px solid var(--fg-border) !important;
    border-radius: 10px !important;
    padding: 11px 12px !important;
    font-size: 13.5px !important;
    line-height: 1.35 !important;
    font-family: var(--fg-font) !important;
    color: var(--fg-text) !important;
    background: #ffffff !important;
    width: 100% !important;
    resize: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#fg-quote-widget .fg-field textarea {
    font-size: 14px !important;
    padding: 11px 14px !important;
}

#fg-quote-widget .fg-field input::placeholder,
#fg-quote-widget .fg-field textarea::placeholder {
    font-size: inherit !important;
    color: var(--fg-text-light) !important;
    opacity: 1 !important;
}

.fg-field input:focus,
.fg-field textarea:focus {
    outline: none;
    border-color: var(--fg-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.fg-field-error-text {
    color: #b42318;
    font-size: 12px;
    display: none;
}

.fg-field.fg-invalid input,
.fg-field.fg-invalid textarea {
    border-color: #b42318;
}

.fg-field.fg-invalid input:focus,
.fg-field.fg-invalid textarea:focus {
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.fg-field.fg-invalid .fg-field-error-text {
    display: block;
}

.fg-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.fg-submit-btn {
    background: var(--fg-blue);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.18), 0 8px 18px rgba(37, 99, 235, 0.16);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.fg-submit-btn:hover {
    background: var(--fg-blue-dark);
}

.fg-submit-btn:active {
    transform: scale(0.98);
}

.fg-submit-btn:disabled {
    background: #a9b6c9;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

@keyframes fg-breathe {
    0%, 100% {
        box-shadow: 0 2px 6px rgba(250, 89, 89, 0.30), 0 8px 20px rgba(250, 89, 89, 0.35), 0 0 0 0 rgba(250, 89, 89, 0.32);
    }
    50% {
        box-shadow: 0 2px 6px rgba(250, 89, 89, 0.30), 0 8px 24px rgba(250, 89, 89, 0.42), 0 0 0 9px rgba(250, 89, 89, 0);
    }
}

@keyframes fg-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fg-teaser-in {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fg-pop-in {
    from {
        opacity: 0;
        transform: scale(0.4);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fg-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    #fg-quote-widget {
        right: 12px;
        bottom: 80px;
        left: 12px;
    }

    .fg-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 88px;
        width: auto;
        height: 75vh;
        max-height: none;
    }

    .fg-panel.fg-compact {
        height: 55vh;
    }

    .fg-launcher {
        justify-content: flex-end;
    }
}
