/* ================================================================
   Traduttore Pro — Stili
   Tutti gli stili sono isolati sotto .trpro-root
   ================================================================ */
.trpro-root{
  --trpro-blue:    #0f2060;
  --trpro-blue-m:  #1c4080;
  --trpro-blue-l:  #2a5ba8;
  --trpro-red:     #e85c1a;
  --trpro-red-d:   #c04010;
  --trpro-bg:      #F4F6FA;
  --trpro-white:   #FFFFFF;
  --trpro-text:    #1a1f2e;
  --trpro-text-m:  #4a5568;
  --trpro-text-s:  #8090a8;
  --trpro-border:  #dde3ee;
  --trpro-font:    -apple-system, 'Segoe UI', Arial, sans-serif;
  --trpro-rad:     18px;
  --trpro-rad-s:   10px;
  --trpro-sh:      0 8px 40px rgba(15,32,96,.18), 0 2px 8px rgba(15,32,96,.08);
  font-family: var(--trpro-font);
  font-size: 16px;
  line-height: 1.5;
  box-sizing: border-box;
}
.trpro-root *,.trpro-root *::before,.trpro-root *::after{ box-sizing:border-box; }

/* ── FINESTRA CHAT ── */
.trpro-root .chat-window{
  width:100%;height:600px;
  background:var(--trpro-bg);
  border-radius:var(--trpro-rad);
  box-shadow:var(--trpro-sh);
  display:flex;flex-direction:column;
  overflow:hidden;position:relative;margin:0;padding:0;
}
.trpro-float-wrap .chat-window{ width:390px;height:570px; }
@media(max-width:520px){
  .trpro-float-wrap{right:0!important;bottom:0!important;}
  .trpro-float-wrap .chat-window{border-radius:18px 18px 0 0!important;width:100vw!important;height:84vh!important;}
}

/* ── INTESTAZIONE ── */
.trpro-root .chat-header{
  padding:13px 16px;display:flex;align-items:center;gap:11px;
  position:relative;flex-shrink:0;transition:background .5s ease;
}
.trpro-root .chat-header::after{
  content:'';position:absolute;bottom:0;left:0;right:0;height:1px;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent);
}
.trpro-root .av-wrap{position:relative;flex-shrink:0;}
.trpro-root .av-img{
  width:48px;height:48px;border-radius:50%;
  border:2px solid rgba(255,255,255,.35);
  overflow:hidden;background:var(--trpro-blue-m);
}
.trpro-root .av-img img,.trpro-root .av-img svg{width:100%;height:100%;object-fit:cover;display:block;}
.trpro-root .online-dot{
  position:absolute;bottom:1px;right:1px;
  width:12px;height:12px;background:#34d399;border-radius:50%;
  border:2.5px solid transparent;
  animation:trproDot 2.2s ease-in-out infinite;
}
@keyframes trproDot{0%,100%{transform:scale(1)}50%{transform:scale(1.3);opacity:.7}}
.trpro-root .mgr-info{flex:1;min-width:0;}
.trpro-root .hdr-name{
  font-size:15px;font-weight:700;color:#fff;
  display:flex;align-items:center;gap:6px;margin:0;padding:0;
}
.trpro-root .hdr-online{font-size:11px;font-weight:700;color:#34d399;}
.trpro-root .hdr-role{font-size:11px;color:rgba(255,255,255,.55);margin-top:2px;}
.trpro-root .hdr-phone{
  font-size:11px;font-weight:600;color:rgba(255,255,255,.7);
  margin-top:1px;text-decoration:none;display:block;
}
.trpro-root .hdr-phone:hover{color:#fff;text-decoration:none;}
.trpro-root .hdr-btns{display:flex;gap:6px;flex-shrink:0;}
.trpro-root .hdr-btn{
  width:28px;height:28px;border:none;border-radius:50%;
  background:rgba(255,255,255,.1);color:rgba(255,255,255,.7);
  cursor:pointer;font-size:13px;
  display:flex;align-items:center;justify-content:center;
  transition:all .2s;padding:0;margin:0;line-height:1;
}
.trpro-root .hdr-btn:hover{background:rgba(255,255,255,.22);color:#fff;}
.trpro-root .hdr-call{background:rgba(232,92,26,.3);color:#ffa080;}
.trpro-root .hdr-call:hover{background:rgba(232,92,26,.6);color:#fff;}

/* ── MESSAGGI ── */
.trpro-root .messages{
  flex:1;overflow-y:auto;padding:14px 13px 6px;
  display:flex;flex-direction:column;gap:8px;scroll-behavior:smooth;
}
.trpro-root .messages::-webkit-scrollbar{width:4px;}
.trpro-root .messages::-webkit-scrollbar-thumb{background:#c8d4e8;border-radius:2px;}
.trpro-root .msg{display:flex;gap:8px;animation:trproFadeUp .28s ease both;margin:0;}
@keyframes trproFadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.trpro-root .msg.bot {align-self:flex-start;max-width:92%;}
.trpro-root .msg.user{align-self:flex-end;  max-width:92%;flex-direction:row-reverse;}
.trpro-root .m-av{width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;align-self:flex-end;margin-top:2px;}
.trpro-root .m-av img,.trpro-root .m-av svg{width:100%;height:100%;object-fit:cover;display:block;}
.trpro-root .m-from{font-size:9.5px;font-weight:700;color:var(--trpro-text-s);padding-left:36px;margin-bottom:1px;letter-spacing:.03em;text-transform:uppercase;}
.trpro-root .bubble{padding:9px 13px;border-radius:14px;font-size:13px;line-height:1.55;margin:0;}
.trpro-root .msg.bot  .bubble{background:var(--trpro-white);color:var(--trpro-text);border-bottom-left-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.06);}
.trpro-root .msg.user .bubble{background:var(--trpro-blue-m);color:#fff;border-bottom-right-radius:4px;}
.trpro-root .m-time{font-size:9.5px;color:var(--trpro-text-s);margin-top:3px;}
.trpro-root .msg.bot  .m-time{padding-left:36px;}
.trpro-root .msg.user .m-time{text-align:right;}

/* ── INDICATORE DIGITAZIONE ── */
.trpro-root .typing-row{display:flex;gap:8px;align-items:flex-end;animation:trproFadeUp .2s ease both;}
.trpro-root .typing-dots{
  padding:10px 14px;background:var(--trpro-white);
  border-radius:14px;border-bottom-left-radius:4px;
  box-shadow:0 1px 5px rgba(0,0,0,.06);
  display:flex;gap:5px;align-items:center;
}
.trpro-root .typing-dots span{width:6px;height:6px;background:#a0b4cc;border-radius:50%;animation:trproTdot 1.35s ease-in-out infinite;display:block;}
.trpro-root .typing-dots span:nth-child(2){animation-delay:.18s;}
.trpro-root .typing-dots span:nth-child(3){animation-delay:.36s;}
@keyframes trproTdot{0%,80%,100%{transform:translateY(0);opacity:.45}40%{transform:translateY(-5px);opacity:1}}

/* ── PULSANTI RISPOSTA RAPIDA ── */
.trpro-root .qr-group{padding-left:36px;display:flex;flex-wrap:wrap;gap:6px;margin-top:4px;animation:trproFadeUp .3s ease .1s both;}
.trpro-root .qr-btn{
  padding:7px 13px;border:1.5px solid var(--trpro-blue-m);
  background:var(--trpro-white);color:var(--trpro-blue-m);
  border-radius:20px;font-family:var(--trpro-font);font-size:12px;font-weight:600;
  cursor:pointer;transition:all .2s;text-align:left;line-height:1.3;
  display:inline-block;margin:0;-webkit-appearance:none;appearance:none;
}
.trpro-root .qr-btn:hover{background:var(--trpro-blue-m);color:#fff;transform:translateY(-1px);box-shadow:0 3px 10px rgba(28,64,128,.2);}
.trpro-root .qr-btn.off{opacity:.45;cursor:default;transform:none!important;box-shadow:none!important;}
.trpro-root .qr-btn.cta{background:var(--trpro-red);border-color:var(--trpro-red);color:#fff;}
.trpro-root .qr-btn.cta:hover{background:var(--trpro-red-d);border-color:var(--trpro-red-d);}
.trpro-root .qr-btn.hint{border-style:dashed;opacity:.6;font-size:11px;}

/* ── INPUT INLINE ── */
.trpro-root .ii-wrap{padding-left:36px;margin-top:4px;animation:trproFadeUp .28s ease both;}
.trpro-root .ii-wrap input{
  width:100%;padding:9px 13px;border:1.5px solid var(--trpro-border);
  border-radius:var(--trpro-rad-s);font-family:var(--trpro-font);font-size:13px;
  color:var(--trpro-text);background:#f8faff;outline:none;transition:border-color .2s;
  display:block;margin:0;
}
.trpro-root .ii-wrap input:focus{border-color:var(--trpro-blue-m);}
.trpro-root .ii-btn{
  margin-top:6px;padding:8px 18px;border:none;border-radius:8px;
  background:var(--trpro-blue-m);color:#fff;font-family:var(--trpro-font);
  font-size:12px;font-weight:700;cursor:pointer;transition:filter .2s;
  -webkit-appearance:none;appearance:none;
}
.trpro-root .ii-btn:hover{filter:brightness(1.15);}

/* ── ZONA CARICAMENTO ── */
.trpro-root .uz-wrap{padding-left:36px;margin-top:4px;animation:trproFadeUp .28s ease both;}
.trpro-root .drop-area{
  border:2px dashed var(--trpro-border);border-radius:var(--trpro-rad-s);
  padding:18px 16px;text-align:center;cursor:pointer;
  transition:all .2s;background:var(--trpro-white);
}
.trpro-root .drop-area:hover,.trpro-root .drop-area.over{border-color:var(--trpro-blue-m);background:#f0f4ff;}
.trpro-root .drop-area input{display:none;}
.trpro-root .drop-ico{font-size:28px;margin-bottom:6px;display:block;}
.trpro-root .drop-lbl{font-size:12px;color:var(--trpro-text-m);line-height:1.6;}
.trpro-root .drop-lbl strong{color:var(--trpro-blue-m);}
.trpro-root .fchip{
  display:flex;align-items:center;gap:7px;padding:7px 10px;
  background:#eef2ff;border-radius:8px;margin-top:7px;font-size:11.5px;
}
.trpro-root .fchip .fn{flex:1;font-weight:600;color:var(--trpro-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.trpro-root .fchip .fsz{color:var(--trpro-text-s);}
.trpro-root .fchip .fspin{width:13px;height:13px;border:2px solid #c8d8f0;border-top-color:var(--trpro-blue-m);border-radius:50%;animation:trproSpin .7s linear infinite;flex-shrink:0;}
.trpro-root .fchip .fprog{color:var(--trpro-text-m);font-size:10.5px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.trpro-root .word-note{font-size:11px;color:var(--trpro-text-s);margin-top:4px;padding-left:2px;}
@keyframes trproSpin{to{transform:rotate(360deg)}}

/* ── CARD PREVENTIVO ── */
.trpro-root .price-card{
  background:linear-gradient(135deg,#07153d 0%,#1c4080 100%);
  border-radius:12px;padding:15px 16px;margin-top:10px;color:#fff;
}
.trpro-root .pc-lbl{font-size:10px;opacity:.6;text-transform:uppercase;letter-spacing:.7px;margin-bottom:5px;font-weight:600;}
.trpro-root .pc-amt{font-size:32px;font-weight:800;line-height:1;letter-spacing:-.5px;}
.trpro-root .pc-det{font-size:11px;opacity:.65;margin-top:5px;line-height:1.5;}

/* ── CARD SUCCESSO ── */
.trpro-root .sc-card{text-align:center;padding:10px 4px;}
.trpro-root .sc-ico{font-size:36px;margin-bottom:8px;display:block;}
.trpro-root .sc-ttl{font-size:14px;font-weight:800;color:var(--trpro-text);margin-bottom:5px;}
.trpro-root .sc-txt{font-size:12px;color:var(--trpro-text-m);line-height:1.6;}
.trpro-root .sc-phone{
  display:inline-block;margin-top:8px;padding:6px 16px;
  background:var(--trpro-blue-m);color:#fff;border-radius:20px;
  font-size:12px;font-weight:700;text-decoration:none;
}
.trpro-root .sc-phone:hover{background:var(--trpro-blue);text-decoration:none;}

/* ── BARRA INPUT ── */
.trpro-root .input-bar{
  padding:10px 12px;background:var(--trpro-white);
  border-top:1px solid var(--trpro-border);
  display:flex;gap:7px;align-items:flex-end;flex-shrink:0;
}
.trpro-root .ib-attach{
  width:36px;height:36px;border:1.5px solid var(--trpro-border);
  border-radius:50%;background:var(--trpro-white);color:var(--trpro-text-m);
  cursor:pointer;font-size:15px;
  display:flex;align-items:center;justify-content:center;
  transition:all .2s;flex-shrink:0;padding:0;
}
.trpro-root .ib-attach:hover{border-color:var(--trpro-blue-m);color:var(--trpro-blue-m);}
.trpro-root .ib-field{
  flex:1;padding:8px 13px;border:1.5px solid var(--trpro-border);
  border-radius:18px;font-family:var(--trpro-font);font-size:13px;
  color:var(--trpro-text);background:var(--trpro-bg);
  outline:none;resize:none;min-height:36px;max-height:88px;
  transition:border-color .2s;display:block;margin:0;
}
.trpro-root .ib-field:focus{border-color:var(--trpro-blue-m);background:var(--trpro-white);}
.trpro-root .ib-field::placeholder{color:var(--trpro-text-s);}
.trpro-root .ib-send{
  width:36px;height:36px;border:none;border-radius:50%;
  background:var(--trpro-blue-m);color:#fff;cursor:pointer;font-size:14px;
  display:flex;align-items:center;justify-content:center;
  transition:all .2s;flex-shrink:0;padding:0;
}
.trpro-root .ib-send:hover{transform:scale(1.07);filter:brightness(1.12);}

/* ── FAB (pulsante flottante) ── */
.trpro-fab{
  position:fixed;bottom:24px;right:80px;
  width:64px;height:64px;
  background:linear-gradient(135deg,#07153d,#1c4080);
  border:none;border-radius:50%;cursor:pointer;
  box-shadow:0 4px 20px rgba(15,32,96,.45);
  display:flex;align-items:center;justify-content:center;font-size:26px;
  transition:all .3s cubic-bezier(.34,1.56,.64,1);z-index:99990;padding:0;
}
.trpro-fab:hover{transform:scale(1.1);box-shadow:0 6px 28px rgba(15,32,96,.6);}
.trpro-fab-badge{
  position:absolute;top:-3px;right:-3px;
  width:20px;height:20px;background:var(--trpro-red);border-radius:50%;
  font-size:10px;color:#fff;font-weight:800;
  display:flex;align-items:center;justify-content:center;
  border:2.5px solid #fff;
}
.trpro-float-wrap{
  position:fixed;bottom:100px;right:80px;
  z-index:99991;transform-origin:bottom right;
  transition:transform .4s cubic-bezier(.34,1.56,.64,1),opacity .35s ease;
}
.trpro-float-wrap.hidden{transform:scale(.75);opacity:0;pointer-events:none;}
@media(max-width:520px){
  .trpro-fab{right:16px;bottom:16px;}
  .trpro-float-wrap{right:0;bottom:0;}
}
