/* Hidrogarant - live chat + asistent AI (widget). [fork F] */
.hgc { --hgc-brand: var(--brand, #fc8006); --hgc-ink: var(--ink, #152229); --hgc-muted: var(--muted, #5d6b74); font-family: var(--font, system-ui, sans-serif); }
.hgc-fab {
    position: fixed; z-index: 135; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom));
    display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 16px; border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px; color: #fff; background: rgba(21, 34, 41, .86); cursor: pointer; font: 700 .92rem/1 var(--font, system-ui);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 18px 40px -14px rgba(0,0,0,.55);
    opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .3s ease, transform .3s ease, background .2s;
}
.hgc-fab.in { opacity: 1; transform: none; }
.hgc-fab:hover { background: rgba(21, 34, 41, .95); }
.hgc-fab:focus-visible { outline: 3px solid var(--hgc-brand); outline-offset: 3px; }
.hgc-fab svg { color: var(--hgc-brand); flex: none; }
.hgc-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: #c0362c; color: #fff; font-size: 11px; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.hgc.is-open .hgc-fab { opacity: 0; pointer-events: none; transform: translateY(14px) scale(.9); }
body.has-cookie-sheet .hgc-fab { opacity: 0 !important; pointer-events: none; }

.hgc-panel {
    position: fixed; z-index: 260; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom));
    width: 390px; height: min(620px, calc(100vh - 110px)); display: flex; flex-direction: column; overflow: hidden;
    border-radius: 24px; background: rgba(255, 255, 255, .86); border: 1px solid rgba(255,255,255,.7);
    -webkit-backdrop-filter: saturate(170%) blur(22px); backdrop-filter: saturate(170%) blur(22px);
    box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 30px 70px -20px rgba(21, 34, 41, .45);
    color: var(--hgc-ink); animation: hgc-in .26s ease;
}
.hgc-panel[hidden] { display: none; }
@keyframes hgc-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.hgc-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 16px; background: rgba(21, 34, 41, .92); color: #fff; }
.hgc-avatar { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--hgc-brand); font-weight: 800; font-size: 1.1rem; }
.hgc-htext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hgc-htext strong { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hgc-status { font-size: .76rem; opacity: .85; display: inline-flex; align-items: center; gap: 6px; }
.hgc-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9aa5ad; }
.hgc-status.is-on::before { background: #2ecc8a; }
.hgc-status.is-ai::before { background: #6aa8ff; }
.hgc-human { flex: none; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; font: 700 .78rem/1 var(--font, system-ui); cursor: pointer; }
.hgc-human:hover { background: rgba(255,255,255,.18); }
.hgc-human[hidden] { display: none; }
.hgc-x { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: #fff; cursor: pointer; }
.hgc-x:hover { background: rgba(255,255,255,.12); }

.hgc-log { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.hgc-msg { max-width: 86%; padding: 9px 12px; border-radius: 16px; font-size: .9rem; line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere; }
.hgc-msg .hgc-body { white-space: pre-wrap; }
.hgc-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.hgc-msg time { display: block; margin-top: 3px; font-size: .68rem; opacity: .55; text-align: right; }
.hgc-who { display: block; font-size: .7rem; font-weight: 700; opacity: .7; margin-bottom: 2px; }
.hgc-me { align-self: flex-end; background: var(--hgc-ink); color: #fff; border-bottom-right-radius: 5px; }
.hgc-me.hgc-failed { opacity: .55; }
.hgc-bot, .hgc-admin { align-self: flex-start; background: #fff; border: 1px solid rgba(21,34,41,.08); border-bottom-left-radius: 5px; }
.hgc-admin { border-color: rgba(252,128,6,.35); }
.hgc-admin .hgc-who { color: var(--brand-600, #e26f00); opacity: 1; }
.hgc-system { align-self: center; max-width: 94%; background: var(--warn-bg, #fff6e5); font-size: .8rem; text-align: center; border-radius: 12px; }

.hgc-cards { display: grid; gap: 8px; align-self: stretch; margin: 2px 0 4px; }
.hgc-card { padding: 10px 12px; border-radius: 14px; background: #fff; border: 1px solid rgba(21,34,41,.08); box-shadow: 0 6px 16px -10px rgba(21,34,41,.3); }
.hgc-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hgc-code { font-weight: 800; font-size: .86rem; color: var(--hgc-ink); text-decoration: none; overflow-wrap: anywhere; }
.hgc-code:hover { text-decoration: underline; }
.hgc-price { flex: none; font-weight: 800; color: var(--brand-600, #e26f00); font-size: .88rem; }
.hgc-meta { font-size: .76rem; color: var(--hgc-muted); margin-top: 2px; }
.hgc-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.hgc-btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px; border: 0; border-radius: 99px; background: var(--hgc-brand); color: #fff; font: 700 .85rem/1 var(--font, system-ui); cursor: pointer; }
.hgc-btn:hover { background: var(--brand-600, #e26f00); }
.hgc-btn-sm { height: 32px; padding: 0 12px; font-size: .78rem; }
.hgc-btn.is-loading { opacity: .6; pointer-events: none; }
.hgc-link { border: 0; background: none; padding: 0; color: var(--hgc-ink); font: 700 .8rem/1 var(--font, system-ui); text-decoration: underline; cursor: pointer; }

.hgc-typing { display: flex; gap: 4px; padding: 0 18px 8px; }
.hgc-typing[hidden] { display: none; }
.hgc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--hgc-muted); opacity: .5; animation: hgc-dot 1s infinite ease-in-out; }
.hgc-typing i:nth-child(2) { animation-delay: .15s; } .hgc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes hgc-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: .9; } }

.hgc-contact { margin: 0 12px 8px; padding: 12px; border-radius: 16px; background: #fff; border: 1px solid rgba(252,128,6,.35); display: grid; gap: 8px; }
.hgc-contact[hidden] { display: none; }
.hgc-contact p { margin: 0; font-size: .84rem; font-weight: 600; }
.hgc-contact input { height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid rgba(21,34,41,.15); font: 500 .9rem var(--font, system-ui); background: #fff; color: var(--hgc-ink); }
.hgc-contact input:focus { outline: 2px solid var(--hgc-brand); outline-offset: 0; border-color: transparent; }
.hgc-crow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hgc-err { color: var(--err, #c0362c); font-size: .78rem; }
.hgc-err[hidden] { display: none; }

.hgc-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(21,34,41,.07); background: rgba(255,255,255,.6); }
.hgc-form textarea { flex: 1; min-height: 42px; max-height: 120px; resize: none; padding: 10px 14px; border-radius: 18px; border: 1px solid rgba(21,34,41,.14); background: #fff; color: var(--hgc-ink); font: 500 .92rem/1.35 var(--font, system-ui); }
.hgc-form textarea:focus { outline: 2px solid var(--hgc-brand); border-color: transparent; }
.hgc-send { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--hgc-brand); color: #fff; cursor: pointer; }
.hgc-send:disabled { opacity: .5; cursor: default; }
.hgc-gdpr { margin: 0; padding: 0 14px 10px; font-size: .68rem; line-height: 1.35; color: var(--hgc-muted); background: rgba(255,255,255,.6); }
.hgc-gdpr a { color: inherit; text-decoration: underline; }

/* Telefon: butonul sta deasupra barei de navigare de jos; panoul ocupa tot ecranul */
@media (max-width: 767px) {
    .hgc-fab { right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); height: 52px; width: 52px; padding: 0; justify-content: center; }
    .hgc-fab-label { display: none; }
    .hgc-panel { inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; background: #f2f4f7; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .hgc-head { padding-top: calc(12px + env(safe-area-inset-top)); }
    .hgc-gdpr { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    .hgc-form textarea { font-size: 16px; } /* fara zoom automat pe iOS */
    html.hgc-lock, html.hgc-lock body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
    .hgc-fab, .hgc-panel, .hgc-typing i { transition: none; animation: none; }
}
@media print { .hgc { display: none !important; } }
