@charset "UTF-8";
/* === DM Sans (self-hosted) === */
@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/DMSans-Regular.woff2') format('woff2'),
       url('../fonts/DMSans-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/DMSans-Medium.woff2') format('woff2'),
       url('../fonts/DMSans-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/DMSans-Bold.woff2') format('woff2'),
       url('../fonts/DMSans-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* === Rendering più nitido === */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* === Base globale === */
body {
  margin: 0;
  padding: 0;
  font-family: 'DM Sans', Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.2px;
  background: #cb0000;     /* Rosso Vodafone */
  color: #000;
}

/* ===== Header ===== */
#logo-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  padding: 5px 30px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
}

#logo-container img {
  max-height: 40px;
  max-width: 45%;
  object-fit: contain;
  height: auto;
  width: auto;
}

/* ===== Chatbox ===== */
#chat-container {
  display: flex;
  justify-content: center;
  padding: 5px;
   background: linear-gradient(180deg, #FF1A1A 0%, #CC0000 100%);
}

#chat-box {
  width: 100%;
  max-width: 480px;
  height: 60vh;
  margin: 0 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 5px;
  scrollbar-width: none;
}

#chat-box::-webkit-scrollbar {
  display: none;
}



/* ===== Messaggi ===== */
.message-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  margin: 5px 0;
  animation: fadeIn 0.35s ease-in-out;
}

.bot-avatar {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: contain;
  align-self: flex-end;
  transform: translateY(2px); /* più dolce */
  transition: transform 0.3s ease; /* effetto morbido se la bolla si muove */
}




.user-message {
  align-self: flex-end;
  background-color: #29b3a3;
  color: #fff;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 15px;
  max-width: 80%;
   margin: 6px 0 12px 0; /* un po’ più spazio sotto l’input */
  animation: fadeIn 0.25s ease-in-out;
}

/* ===== Strong e Emoji ===== */
.bot-message strong {
  font-weight: 600;
}

.bot-message emoji,
.bot-message span,
.bot-message img.emoji {
  vertical-align: middle;
  transform: scale(0.95);
}




/* ===== Input (CAP o Numero) ===== */
.input-container {
  background: #fff;
  color: #000;
  padding: 15px 20px;
  border-radius: 25px;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  max-width: 85%;
  margin-left: 50px;     /* nuovo: allinea alla colonna bot */
  text-align: left;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.6s ease forwards;
}


.input-container input {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 10px;
  font-size: 15px;
  margin-bottom: 8px;
  box-sizing: border-box;
  outline: none;
}

.input-container input:focus {
  border-color: #d20707;
  box-shadow: 0 0 4px rgba(210, 7, 7, 0.3);
}

.input-container button {
  width: 100%;
  background: linear-gradient(90deg, #FF2B2B 0%, #D90000 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.input-container button:hover {
  background-color: #001a33;
}

/* Privacy */
.privacy-container {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
  text-align: left;
}

.privacy-container a {
  color: #006273;
  text-decoration: underline;
  font-weight: 500;
}

/* ===== Pulsanti (Sì / No) ===== */
.button-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
  width: 100%;
  max-width: 600px;
  margin: 5px 0;
}


.button-container button {
  background: #0a1f44;
  color: #fff;
  border: 2px solid #0a1f44;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 18px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.button-container button:hover {
  background: #122b57;
  border-color: #122b57;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.button-container button small {
  display: block;
  font-size: 13px;
  margin-top: 3px;
  font-weight: 400;
  color: #bcd4ff;
}

.legal-row{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;margin:.5rem 0}
.legal-pill{border:0;padding:.25rem .6rem;border-radius:999px;font-size:.85rem;cursor:pointer;background:#f0bf4c}
.legal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:9998;opacity:0;transition:opacity .2s}
.legal-backdrop.show{opacity:1}
.legal-modal{position:fixed;left:0;right:0;bottom:0;max-height:75vh;background:#fff;border-radius:16px 16px 0 0;z-index:9999;transform:translateY(100%);transition:transform .25s ease;display:flex;flex-direction:column}
.legal-modal.show{transform:translateY(0)}
.legal-h{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #eee}
.legal-b{padding:12px 16px;overflow:auto;line-height:1.4;font-size:.95rem}
.legal-ack{display:flex;align-items:center;gap:.5rem;padding:8px 16px}
.legal-cta{margin:8px 16px 16px;padding:12px 14px;border:0;border-radius:10px;cursor:pointer;background:#f0bf4c}
.legal-cta[disabled]{opacity:.6;cursor:not-allowed}
.legal-close{background:transparent;border:0;font-size:1.1rem;cursor:pointer}
.legal-note{
  font-size:.6rem; color:#6b7280; line-height:1.35;
}
.legal-note strong{ font-weight:600; color:inherit; }

/* Falso link accessibile */
.legal-link{
  background:none; border:0; padding:0;
  font:inherit; color:#00000082;      /* blu link */
  text-decoration:underline; cursor:pointer;
  font-size:.6rem;
}
.legal-link:hover{ text-decoration:none; }
.legal-link:focus-visible{ outline:2px solid currentColor; outline-offset:2px; border-radius:2px; 
    
}


/* ===== AI Welcome Modal ===== */
.aiw-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.aiw-modal{
  width: min(560px, 92vw);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 55px rgba(0,0,0,.25);
  overflow: hidden;
  font-family: inherit;
}
.aiw-head{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 16px 18px 10px;
}
.aiw-badge{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.06);
  flex: 0 0 auto;
}
.aiw-title{
  margin:0;
  font-size: 16px;
  font-weight: 800;
}
.aiw-body{
  padding: 0 18px 14px;
  font-size: 13px;
  line-height: 1.35;
  color: #222;
}
.aiw-body p{ margin: 10px 0; }
.aiw-body a{
  color: #0b69ff;
  text-decoration: underline;
}
.aiw-actions{
  padding: 14px 18px 18px;
  display:flex;
  justify-content:flex-start;
  gap: 10px;
}
.aiw-btn{
  border:0;
  cursor:pointer;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 800;
}
.aiw-btn-primary{
  background: #ffcc00;
  color: #111;
}
.aiw-btn-primary:active{ transform: translateY(1px); }



/* ===== Footer ===== */
#footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #fff;
  padding: 5px;
  text-align: center;
  font-size: 10px;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

/* ===== Animazioni ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  #chat-box { max-width: 100%; padding:5px; }
  .card { font-size: 14.5px; }
  .card h4 { font-size: 15px; }
  .card .price { font-size: 16px; }
}

@media (min-width: 768px) {
  .bot-message {
    font-size: 17px;
    line-height: 1.5;
    padding: 15px 20px;
  }
}



.input-container input {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 10px;
  font-size: 15px;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.input-container button {
  width: 100%;
  background-color: #193755;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.input-container button:hover {
  background-color: #001a33;
}

/* Allinea l'input (numero o CAP) con le bolle del bot */
#numero-input-container {
  margin-left: 50px;   /* distanza identica allo spazio dell’avatar */
  max-width: 85%;      /* stessa larghezza delle bot-message */
  text-align: left;    /* allinea il testo internamente a sinistra */
  width: 100%;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.6s ease forwards;
}








/* Hover */
.button-container button:hover {
  background: #122b57;
  border-color: #122b57;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Testo secondario */
.button-container button small {
  display: block;
  font-size: 13px;
  margin-top: 3px;
  font-weight: 400;
  color: #bcd4ff;
}

.bot-message.followed-by-input {
  margin-left: 50px;   /* allinea come la bolla input */
  max-width: 85%;      /* stessa larghezza visiva */
}
.error-message {
  display: block;
  
  font-weight: 500;
  margin-top: 6px;
  margin-bottom: 8px;
  text-align: left;
  padding-left: 4px;
  transition: all 0.2s ease-in-out;
  color: red;
  font-size: 12px;
}

input.error {
  border: 1.5px solid #e60000 !important; /* rosso brand solo sul bordo */
  box-shadow: 0 0 6px rgba(230, 0, 0, 0.25);
}



/* piccolo tocco di animazione */
.error-message.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}





/* ======================================================
   🫧 Effetti dolci per bolla e pallini (by Horizon)
   ====================================================== */

/* 🌱 Fase iniziale: la bolla si gonfia piano da piccola */
.bot-message {
  background: #fff;
  color: #000;
  padding: 10px 15px;
  border-radius: 25px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  max-width: 90%;
  font-size: 16px;
  animation: bubbleAppear 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform-origin: bottom left;
  backface-visibility: hidden;
}

/* 🌬️ Fase “gonfiaggio dolce” */
@keyframes bubbleAppear {
  0%   { transform: scale(0.3) translateY(15px); opacity: 0; }
  50%  { transform: scale(0.8) translateY(5px); opacity: 0.7; }
  80%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* 💭 Bolla typing (3 pallini) */
.bot-message.loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 28px;

  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  animation: bubbleAppear 0.4s ease-out;
  transition: all 0.6s ease;
   border-radius: 25px 25px 25px 0px;
}

/* 🌈 Transizione quando da typing diventa messaggio */
.bot-message.expanded {
  width: auto;
  height: auto;
  padding: 12px 18px;
  border-radius: 26px;
  transition: all 0.6s ease-in-out;
}

/* ⚪ I tre pallini del loader */
.typing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 14px;
}

.typing-indicator span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #000;
  opacity: 0.25;
  transform: scale(0.7);
  animation: typingSoft 1.5s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

.typing-indicator span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #000;
  opacity: 0.25;
  transform: scale(0.7);
  animation: waveTyping 1.8s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes waveTyping {
  0%, 80%, 100% {
    transform: translateY(0px) scale(0.7);
    opacity: 0.25;
  }
  40% {
    transform: translateY(-6px) scale(1);
    opacity: 0.9;
  }
}




/* 🧡 Testo: entra senza “flash”, ma dolcemente */
.bot-message.expanded p,
.bot-message.expanded span,
.bot-message.expanded strong {
  animation: fadeInTextSoft 0.5s ease forwards;
}

@keyframes fadeInTextSoft {
  0%   { opacity: 0; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Evita scatti di repaint durante le animazioni */
.animated {
  -webkit-transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


.tease {
  text-align: center;
  color: #d60000; /* rosso Vodafone */
  font-weight: 600;
  font-size: 14px;
  margin-top: 10px;
  line-height: 1.4;
}
/* === OFFERTA CHAT NATURALE === */
.offer-message {
  background: none !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 12px 0 !important;
  color: #000;
  font-size: 15px;
  line-height: 1.45;
}

.offer-message strong {
  color: #000;
  font-weight: 600;
}

.offer-message s {
  color: #999;
}

#assist-slot { margin: 12px 14px 6px; }

.assist {
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.assist.hidden { display: none; }

.assist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.assist-title { font-weight: 700; font-size: 14px; color:#111; }

#assistClose {
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
}

.assist-body {
  max-height: 190px;
  overflow: auto;
  padding: 8px;
  background: #fafafa;
  border-radius: 12px;
}

.assist-foot { display: flex; gap: 8px; margin-top: 8px; }

.assist-foot input {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #ddd;
  outline: none;
}

.assist-foot button {
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
}

.assist-msg { margin: 8px 0; font-size: 14px; line-height: 1.25; }
.assist-msg.bot { color: #111; }
.assist-msg.user { text-align: right; color: #222; }
.assist-meta { font-size: 12px; opacity: .7; margin-top: 4px; }

/* Backdrop */
.assist-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  z-index: 9998;
}
.assist-backdrop.hidden{ display:none; }

/* Bottom-sheet */
#assistChat.assist{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 9999;

  max-height: 62vh;
  display: flex;
  flex-direction: column;

  border-radius: 18px;
  border: 1px solid #eee;
  box-shadow: 0 16px 40px rgba(0,0,0,.22);
}

/* Nascosto */
#assistChat.hidden{ display:none; }

/* Header */
#assistChat .assist-head{
  padding: 12px 12px 8px;
  border-bottom: 1px solid #eee;
}

/* Body scroll */
#assistChat .assist-body{
  padding: 10px 12px;
  overflow: auto;
  max-height: 44vh;
  background: #fafafa;
  border-radius: 14px;
  margin: 10px 12px;
}

/* Footer input */
#assistChat .assist-foot{
  padding: 10px 12px 12px;
  display: flex;
  gap: 8px;
  border-top: 1px solid #eee;
  background: #fff;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

/* ====== Chat AI input bar finale ====== */
.ai-dock-wrap{
  width:100%;
  box-sizing:border-box;
}

/* contenitore */
.ai-chatbar{
  display:flex;
  align-items:center;
  gap:6px;
  width:100%;
  background:#fff;
  border-radius:18px;
  padding:8px;
  border:1px solid rgba(0,0,0,.12);
  box-shadow:0 8px 20px rgba(0,0,0,.10);
}

/* input comodo da scrivere, non traborda */
.ai-chatbar input{
  flex:1 1 auto;
  min-width:0;                     /* evita overflow */
  border:1px solid rgba(0,0,0,.15);
  border-radius:14px;
  padding:14px 14px;
  font-size:16px;
  outline:none;
  width:100%;
  box-sizing:border-box;
}

/* bottone INVIA piccolo e leggibile */
.ai-chatbar .ai-send{
  flex:0 0 auto;
  white-space:nowrap;
  border:0;
  border-radius:14px;
  padding:12px 16px;
  font-weight:800;
  cursor:pointer;
  background:#d60000;
  color:#fff;
  min-height:48px;
  transition:background .2s;
}
.ai-chatbar .ai-send:hover{
  background:#b70000;
}

/* bottone CONTINUA ben visibile, blu pieno, largo e chiaro */
.ai-chatbar .ai-continue{
  display:none;
  flex:1 1 100%;
  justify-content:center;
  align-items:center;
  border-radius:16px;
  background:#0a1f44;
  color:#fff;
  font-weight:900;
  padding:16px 20px;
  font-size:17px;
  cursor:pointer;
  border:2px solid #0a1f44;
  text-align:center;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
  transition:background .2s,transform .1s;
}
.ai-chatbar .ai-continue:hover{
  background:#132e6b;
}
.ai-chatbar .ai-continue:active{
  transform:translateY(1px);
}

/* quando JS mostra Continua (inline-block), trasformala in bottone unico */
.ai-chatbar .ai-continue[style*="display:inline"],
.ai-chatbar .ai-continue[style*="display: inline-block"],
.ai-chatbar .ai-continue[style*="display:block"]{
  display:flex !important;
  width:100%;
}

/* error */
.ai-err{
  margin-top:8px;
  padding-left:4px;
}

/* mobile */
@media (max-width:480px){
  .ai-chatbar{
    gap:5px;
    padding:8px;
  }
  .ai-chatbar input{padding:13px 12px;}
  .ai-chatbar .ai-send{padding:12px 14px;}
}



@media (max-width: 768px) {
  #footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    background: #fff;
    padding: 11px;
    font-size: 10px;
    color: #193755;
    box-sizing: border-box;
  }
}


.input-container {
  
  opacity: 1 !important;
}
.inline-input.inline-ta{
  width: 100%;
  box-sizing: border-box;
  resize: none;
  overflow: hidden;
  min-height: 44px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  color: #111;
  font-size: 14px;
  line-height: 1.25;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.inline-input.inline-ta:focus{
  border-color: rgba(0,0,0,.35);
  box-shadow: 0 0 0 3px rgba(0,0,0,.08);
}
.inline-input.inline-ta.error{
  border-color: #d93025;
  box-shadow: 0 0 0 3px rgba(217,48,37,.12);
}
/* stesso comportamento di #numero-input-container ma per tutti gli input step */
#chat-box .message-wrapper .input-container{
  margin-left: 50px;
  max-width: 85%;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.6s ease forwards;
}
