/* Widget auto-contenuti (chatbot + cookie) — estratti da style.css
   per funzionare sulla nuova home senza caricare l'intero design system. */

:root {
  --bg-primary: #060b18;
  --bg-secondary: #0b1220;
  --bg-card: #0f1829;
  --bg-card-hover: #131e33;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(244, 114, 182, 0.3);

  --accent-blue: #60a5fa;
  --accent-purple: #a78bfa;
  --accent-pink: #f472b6;
  --accent-cyan: #22d3ee;
  --accent-color: var(--accent-pink);

  --gradient-main: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);
  --gradient-pink: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
  --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  --gradient-hero: linear-gradient(180deg, rgba(6,11,24,0) 0%, rgba(6,11,24,0.5) 60%, var(--bg-primary) 100%);

  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-main: 'Inter', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 30px;

  --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.4);
  --shadow-pink: 0 0 40px rgba(244, 114, 182, 0.15);
  --shadow-blue: 0 0 40px rgba(96, 165, 250, 0.15);
  --shadow-glow: 0 0 80px rgba(167, 139, 250, 0.12);

  --nav-height: 72px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Chatbot ── */
.chatbot-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  pointer-events: none;
}
.chatbot-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-blue);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(34, 211, 238, 0.45);
  transition: var(--transition);
  cursor: pointer;
  border: none;
  pointer-events: auto;
}
.chatbot-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(34, 211, 238, 0.6);
}
.chatbot-panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 360px;
  height: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform-origin: bottom right;
  pointer-events: auto;
}
.chatbot-panel.hidden {
  opacity: 0;
  transform: scale(0.85) translateY(10px);
  pointer-events: none;
}
.chatbot-header {
  background: var(--gradient-pink);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.chatbot-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.chatbot-header-info { flex: 1; }
.chatbot-header-info strong { display: block; font-size: 0.95rem; font-weight: 700; }
.chatbot-header-info span { font-size: 0.75rem; opacity: 0.85; }
.chatbot-status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 6px #4ade80;
  animation: pulse 2s infinite;
}
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }
.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  animation: fadeInUp 0.3s ease;
}
.chat-msg.bot {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  color: var(--text-primary);
}
.chat-msg.user {
  background: var(--gradient-pink);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  color: #fff;
}
.chat-msg.system {
  align-self: center;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  color: #4ade80;
  font-size: 0.78rem;
  border-radius: 100px;
  padding: 6px 14px;
  max-width: 90%;
  text-align: center;
}
.chatbot-quick-replies {
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}
.quick-reply {
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.06);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.quick-reply:hover { background: rgba(34, 211, 238, 0.15); }
.chatbot-input-area {
  border-top: 1px solid var(--border-color);
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}
.chatbot-input-area input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}
.chatbot-input-area input:focus { border-color: var(--accent-cyan); }
.chatbot-input-area input::placeholder { color: var(--text-muted); }
.chatbot-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: var(--transition);
}
.chatbot-send-btn:hover { transform: scale(1.05); }
.chatbot-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}
.chatbot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.4s infinite ease-in-out;
}
.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

/* ── Keyframes ── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ── Cookie banner ── */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  z-index: 9998;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.cookie-banner.hidden { opacity: 0; pointer-events: none; transform: translateY(20px); }
.cookie-banner p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.6; }
.cookie-banner p a { color: var(--accent-pink); }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.cookie-accept {
  background: var(--gradient-pink);
  color: #fff;
  border: none;
}
.cookie-decline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.cookie-decline:hover { border-color: var(--accent-pink); color: var(--accent-pink); }

/* ═══════════════════════════════════════════════════════════
   Restyle chatbot — coerente col design v2 (ink + magenta)
   Regole in coda: vincono per ordine di cascata.
   ═══════════════════════════════════════════════════════════ */
.chatbot-toggle-btn{
  background:#D6336C;
  box-shadow:0 10px 30px -8px rgba(214,51,108,.55);
}
.chatbot-toggle-btn:hover{box-shadow:0 14px 38px -8px rgba(214,51,108,.75);transform:scale(1.06)}
.chatbot-panel{
  background:#17151C;
  border:1px solid rgba(245,244,240,.12);
  border-radius:18px;
  box-shadow:0 40px 80px -30px rgba(0,0,0,.75);
}
.chatbot-header{
  background:#1C1B21;
  border-bottom:1px solid rgba(245,244,240,.10);
}
.chatbot-header-avatar{
  background:rgba(214,51,108,.16);
  border:1px solid rgba(214,51,108,.4);
}
.chatbot-header-info strong{color:#F5F4F0;letter-spacing:-.01em}
.chatbot-header-info span{
  color:#9B97A6;font-family:ui-monospace,"Cascadia Mono",Consolas,monospace;
  font-size:.6rem;letter-spacing:.12em;text-transform:uppercase;opacity:1;
}
.chatbot-status-dot{
  background:#3FCF8E;box-shadow:0 0 0 0 rgba(63,207,142,.5);
  animation:chatLive 1.6s infinite;
}
@keyframes chatLive{
  0%{box-shadow:0 0 0 0 rgba(63,207,142,.5)}
  70%{box-shadow:0 0 0 6px rgba(63,207,142,0)}
  100%{box-shadow:0 0 0 0 rgba(63,207,142,0)}
}
.chatbot-messages{background:#17151C}
.chatbot-messages::-webkit-scrollbar-thumb{background:rgba(245,244,240,.18)}
.chat-msg.bot{
  background:rgba(245,244,240,.06);
  border:1px solid rgba(245,244,240,.08);
  color:#EDEBF0;
}
.chat-msg.bot strong{color:#EE7FA6}
.chat-msg.user{background:#D6336C;color:#fff;border:none}
.chatbot-quick-replies{border-top:1px solid rgba(245,244,240,.08)}
.quick-reply{
  border:1px solid rgba(214,51,108,.5);
  color:#EE7FA6;background:transparent;border-radius:999px;font-weight:500;
  transition:background .2s,border-color .2s,color .2s;
}
.quick-reply:hover{background:rgba(214,51,108,.15);border-color:#D6336C;color:#fff}
.chatbot-input-area{background:#141317;border-top:1px solid rgba(245,244,240,.10)}
.chatbot-input-area input{
  background:rgba(245,244,240,.05);
  border:1px solid rgba(245,244,240,.12);
  color:#F5F4F0;border-radius:10px;
}
.chatbot-input-area input:focus{border-color:#D6336C}
.chatbot-input-area input::placeholder{color:#7c7986}
.chatbot-send-btn{background:#D6336C;color:#fff;box-shadow:0 4px 14px -4px rgba(214,51,108,.6)}
.chatbot-typing span{background:#9B97A6}

/* ── Responsive widget (mobile) ── */
.chatbot-panel{
  width:min(360px,calc(100vw - 32px));
  height:min(520px,calc(100vh - 130px));
}
@media(max-width:560px){
  .chatbot-fab{bottom:16px;right:16px}
  /* bottom sopra la bolla chat, per non coprire il tasto Rifiuta */
  .cookie-banner{left:16px;right:16px;bottom:92px;max-width:none;padding:18px}
}
