/* Chat d’aide EretuPay */
.help-chat {
    --hc-accent: #008694;
    --hc-accent-dark: #007985;
    --hc-ink: #0f172a;
    --hc-muted: #64748b;
    --hc-surface: #ffffff;
    --hc-bg: #f2f8f9;
    --hc-border: #d5e6e8;
    --hc-bot: #e8f6f7;
    --hc-user: #008694;
    --hc-shadow: 0 12px 40px rgba(15, 23, 42, 0.16);
    position: fixed;
    z-index: 10050;
    right: 1.25rem;
    bottom: 1.25rem;
    font-family: "IBM Plex Sans", system-ui, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.help-chat__launcher {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 999px;
    padding: 0.85rem 1.15rem;
    background: linear-gradient(165deg, #043f45 0%, #055a62 55%, var(--hc-accent) 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--hc-shadow);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.help-chat__launcher:hover,
.help-chat__launcher:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 44px rgba(4, 63, 69, 0.28);
    outline: none;
}

.help-chat__launcher i {
    font-size: 1.1rem;
}

.help-chat.is-open .help-chat__launcher {
    display: none;
}

.help-chat__panel {
    display: none;
    flex-direction: column;
    width: min(100vw - 2rem, 380px);
    height: min(70vh, 520px);
    background: var(--hc-surface);
    border: 1px solid var(--hc-border);
    border-radius: 16px;
    box-shadow: var(--hc-shadow);
    overflow: hidden;
}

.help-chat.is-open .help-chat__panel {
    display: flex;
}

.help-chat__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.85rem;
    background: linear-gradient(165deg, #043f45 0%, #055a62 100%);
    color: #fff;
}

.help-chat__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.help-chat__subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    opacity: 0.85;
}

.help-chat__close {
    border: 0;
    background: transparent;
    color: #fff;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.9;
}

.help-chat__close:hover,
.help-chat__close:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.help-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--hc-bg);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.help-chat__bubble {
    max-width: 92%;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.help-chat__bubble--bot {
    align-self: flex-start;
    background: var(--hc-bot);
    color: var(--hc-ink);
    border: 1px solid var(--hc-border);
}

.help-chat__bubble--user {
    align-self: flex-end;
    background: var(--hc-user);
    color: #fff;
}

.help-chat__bubble--error {
    align-self: stretch;
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-size: 0.875rem;
}

.help-chat__bubble--loading {
    align-self: flex-start;
    color: var(--hc-muted);
    font-style: italic;
    background: transparent;
    border: 0;
    padding: 0.25rem 0.4rem;
}

.help-chat__form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--hc-border);
    background: var(--hc-surface);
}

.help-chat__input {
    resize: none;
    border: 1px solid var(--hc-border);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    font: inherit;
    color: var(--hc-ink);
    background: #fff;
}

.help-chat__input:focus {
    outline: 2px solid rgba(0, 134, 148, 0.35);
    border-color: var(--hc-accent);
}

.help-chat__send {
    align-self: end;
    border: 0;
    border-radius: 10px;
    padding: 0.55rem 0.9rem;
    background: var(--hc-accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.help-chat__send:hover,
.help-chat__send:focus-visible {
    background: var(--hc-accent-dark);
    outline: none;
}

.help-chat__send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.help-chat__status {
    margin: 0;
    padding: 0 0.75rem 0.65rem;
    font-size: 0.8rem;
    color: #b91c1c;
}

.help-chat .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    .help-chat {
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .help-chat__panel {
        width: calc(100vw - 1.5rem);
        height: min(75vh, 560px);
    }

    .help-chat__launcher-label {
        display: none;
    }

    .help-chat__launcher {
        width: 3.25rem;
        height: 3.25rem;
        justify-content: center;
        padding: 0;
        border-radius: 50%;
    }
}
