/* Assistente virtuale (js/chatbot.js). Pulsante sopra quello delle preferenze cookie di iubenda (anch'esso in basso a destra). */
.gcb { --gcb-sea: var(--gc-sea, #1592d1); --gcb-sea-dark: var(--gc-sea-dark, #0f6fa3); --gcb-ink: var(--gc-ink, #13212e); --gcb-border: var(--gc-border, #dde5ec); font-family: var(--gc-font, system-ui, sans-serif); }
.gcb-toggle { position: fixed; right: 20px; bottom: 80px; z-index: 9990; display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%; background: var(--gcb-sea); color: #fff; cursor: pointer; box-shadow: 0 4px 14px rgba(19, 33, 46, .28); transition: transform .15s, background .15s; }
.gcb-toggle:hover { background: var(--gcb-sea-dark); transform: scale(1.05); }
.gcb-toggle:focus-visible { outline: 3px solid var(--gc-light, #f6c744); outline-offset: 2px; }

.gcb-panel { position: fixed; right: 20px; bottom: 150px; z-index: 9991; display: flex; flex-direction: column; width: 370px; height: min(560px, calc(100vh - 180px)); border: 1px solid var(--gcb-border); border-radius: 14px; background: #fff; color: var(--gcb-ink); box-shadow: 0 10px 40px rgba(19, 33, 46, .25); overflow: hidden; }
.gcb-panel[hidden] { display: none; }

.gcb-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--gcb-sea); color: #fff; }
.gcb-head > div { flex: 1; min-width: 0; }
.gcb-head strong { display: block; font-family: var(--gc-font-title, inherit); font-size: 17px; }
.gcb-head span { display: block; font-size: 12px; opacity: .9; }
.gcb-head button { border: 0; background: transparent; color: #fff; cursor: pointer; }
.gcb-new { padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .6) !important; border-radius: 999px; font-size: 12px; }
.gcb-new:hover { background: rgba(255, 255, 255, .15) !important; }
.gcb-close { padding: 0 4px; font-size: 26px; line-height: 1; }

.gcb-log { flex: 1; overflow-y: auto; padding: 14px; background: var(--gc-bg, #f4f7fa); }
.gcb-msg { max-width: 88%; margin: 0 0 10px; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.gcb-msg p { margin: 0 0 6px; }
.gcb-msg p:last-child { margin-bottom: 0; }
.gcb-msg ul { margin: 4px 0 6px; padding-left: 18px; }
.gcb-msg a { color: var(--gcb-sea-dark); }
.gcb-msg--bot { margin-right: auto; border: 1px solid var(--gcb-border); border-bottom-left-radius: 4px; background: #fff; }
.gcb-msg--user { margin-left: auto; border-bottom-right-radius: 4px; background: var(--gcb-sea); color: #fff; white-space: pre-wrap; }
.gcb-msg--error { margin-right: auto; border: 1px solid #f1c4c4; background: #fdeeee; color: #8a1f1f; }

.gcb-typing { display: inline-flex; gap: 4px; }
.gcb-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa9b7; animation: gcb-dot 1.2s infinite ease-in-out; }
.gcb-typing span:nth-child(2) { animation-delay: .2s; }
.gcb-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes gcb-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.gcb-form { display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px; border-top: 1px solid var(--gcb-border); background: #fff; }
.gcb-form textarea { flex: 1; min-height: 38px; max-height: 120px; padding: 8px 10px; border: 1px solid var(--gcb-border); border-radius: 10px; font: inherit; font-size: 14px; resize: none; box-sizing: border-box; }
.gcb-form textarea:focus { outline: none; border-color: var(--gcb-sea); }
.gcb-form button { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: var(--gcb-sea); color: #fff; cursor: pointer; }
.gcb-form button:disabled { opacity: .5; cursor: default; }

.gcb-note { padding: 6px 12px 9px; background: #fff; color: var(--gc-ink-soft, #4a5a6a); font-size: 11px; line-height: 1.35; }

@media (max-width: 520px) {
    .gcb-toggle { right: 14px; bottom: 76px; width: 52px; height: 52px; }
    .gcb-panel { right: 0; bottom: 0; left: 0; top: 0; width: auto; height: auto; border: 0; border-radius: 0; }
    .gcb--open .gcb-toggle { display: none; }
    .gcb-form textarea { font-size: 16px; } /* evita lo zoom automatico di iOS */
}

@media print { .gcb { display: none; } }
