/* ===== Now Insurance guided chatbot =====
   Floating in-page assistant that replaces the old WhatsApp bubble.
   Modular blocks: launcher, panel, header, transcript, options, forms. */

.now-chat-launcher{
  position:fixed;
  bottom:max(0.75rem,env(safe-area-inset-bottom));
  right:max(0.75rem,env(safe-area-inset-right));
  left:auto;
  width:60px;
  height:60px;
  border-radius:50%;
  border:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.7rem;
  color:#fff;
  cursor:pointer;
  z-index:1000;
  background:linear-gradient(135deg,#17489c 0%,#0b2f6b 55%,#123524 100%);
  box-shadow:0 6px 18px rgba(8,45,102,0.42);
  transition:transform .18s ease, box-shadow .18s ease;
}
.now-chat-launcher:hover{transform:scale(1.06);box-shadow:0 8px 22px rgba(8,45,102,0.5);}
.now-chat-launcher:focus-visible{outline:3px solid var(--accent-gold,#d4af37);outline-offset:3px;}
.now-chat-launcher .now-chat-launcher-dot{
  position:absolute;top:6px;right:6px;width:11px;height:11px;border-radius:50%;
  background:#38d16a;border:2px solid #fff;
}
.now-chat-launcher.is-open{transform:scale(.94);}
/* A third-party chat widget (Tawk.to) owns the corner once it is live. */
.now-chat-launcher.is-superseded{display:none!important;}

/* ---- panel ---- */
.now-chat-panel{
  position:fixed;
  bottom:calc(60px + 1.4rem + env(safe-area-inset-bottom));
  right:max(0.75rem,env(safe-area-inset-right));
  left:auto;
  width:min(392px,calc(100vw - 1.5rem));
  max-height:min(640px,calc(100vh - 7rem));
  display:none;
  flex-direction:column;
  background:#fff;
  border-radius:18px;
  border:1px solid #dbe5de;
  box-shadow:0 22px 48px rgba(15,23,42,.24);
  overflow:hidden;
  z-index:1001;
  font-family:inherit;
}
.now-chat-panel.is-open{display:flex;}

.now-chat-header{
  display:flex;align-items:center;gap:.6rem;
  padding:.85rem .95rem;
  background:linear-gradient(135deg,#0b2f6b 0%,#123524 100%);
  color:#fff;
}
.now-chat-header-avatar{
  width:34px;height:34px;border-radius:10px;flex:0 0 auto;
  display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.14);font-size:1rem;
}
.now-chat-header-text{flex:1 1 auto;min-width:0;}
.now-chat-header-text strong{display:block;font-size:.9rem;font-weight:800;line-height:1.2;}
.now-chat-header-text span{display:block;font-size:.7rem;opacity:.85;line-height:1.3;}
.now-chat-close{
  border:0;background:rgba(255,255,255,.12);color:#fff;
  width:30px;height:30px;border-radius:8px;cursor:pointer;font-size:.85rem;
}
.now-chat-close:hover{background:rgba(255,255,255,.22);}

.now-chat-body{
  flex:1 1 auto;
  overflow-y:auto;
  padding:.9rem .9rem .4rem;
  background:#f7faf8;
}
.now-chat-msg{
  display:flex;margin-bottom:.6rem;
}
.now-chat-msg-bubble{
  max-width:86%;
  padding:.6rem .75rem;
  border-radius:14px;
  font-size:.82rem;
  line-height:1.5;
  white-space:pre-wrap;
  word-break:break-word;
}
.now-chat-msg.bot .now-chat-msg-bubble{
  background:#fff;color:#1f2937;border:1px solid #e2e8f0;border-bottom-left-radius:4px;
}
.now-chat-msg.user{justify-content:flex-end;}
.now-chat-msg.user .now-chat-msg-bubble{
  background:linear-gradient(135deg,#17489c,#0b2f6b);color:#fff;border-bottom-right-radius:4px;
}
.now-chat-msg.system .now-chat-msg-bubble{
  background:#fff8e6;border:1px solid #f0dca6;color:#6b5312;font-size:.76rem;
}
.now-chat-typing .now-chat-msg-bubble{color:#64748b;font-style:italic;}

.now-chat-options{display:flex;flex-direction:column;gap:.4rem;margin:0 0 .7rem;}
.now-chat-option{
  text-align:left;
  border:1px solid #cddbd2;
  background:#fff;
  color:#123524;
  font-size:.8rem;
  font-weight:600;
  padding:.55rem .7rem;
  border-radius:11px;
  cursor:pointer;
  transition:background .15s ease, border-color .15s ease, transform .15s ease;
}
.now-chat-option:hover{background:#eef6f0;border-color:#8fb69c;transform:translateX(2px);}
.now-chat-option.is-secondary{color:#475569;font-weight:600;background:#f8fafc;}
.now-chat-option i{margin-right:.45rem;color:#1b5e20;}

.now-chat-form{display:flex;flex-direction:column;gap:.45rem;margin:0 0 .7rem;}
.now-chat-field label{display:block;font-size:.72rem;font-weight:700;color:#334155;margin-bottom:.15rem;}
.now-chat-field input,.now-chat-field textarea{
  width:100%;border:1px solid #cfdcd4;border-radius:10px;padding:.5rem .6rem;
  font-size:.8rem;font-family:inherit;color:#1f2937;background:#fff;
}
.now-chat-field textarea{min-height:64px;resize:vertical;}
.now-chat-field input:focus,.now-chat-field textarea:focus{outline:2px solid #8fb69c;outline-offset:1px;}
.now-chat-files{font-size:.74rem;color:#475569;}
.now-chat-files ul{margin:.25rem 0 0;padding-left:1.1rem;}
.now-chat-submit{
  border:0;border-radius:11px;padding:.6rem .8rem;font-size:.82rem;font-weight:700;color:#fff;cursor:pointer;
  background:linear-gradient(135deg,#17489c 0%,#123524 100%);
}
.now-chat-submit[disabled]{opacity:.6;cursor:progress;}
.now-chat-note{font-size:.7rem;color:#64748b;line-height:1.45;margin:.1rem 0 .6rem;}

.now-chat-footer{
  border-top:1px solid #e5ebe7;
  background:#fff;
  padding:.55rem .7rem calc(.55rem + env(safe-area-inset-bottom));
}
.now-chat-input-row{display:flex;gap:.4rem;align-items:center;}
.now-chat-input-row input[type="text"]{
  flex:1 1 auto;border:1px solid #cfdcd4;border-radius:11px;padding:.55rem .65rem;font-size:.82rem;font-family:inherit;
}
.now-chat-input-row input[type="text"]:focus{outline:2px solid #8fb69c;outline-offset:1px;}
.now-chat-send{
  border:0;width:40px;height:40px;border-radius:11px;color:#fff;cursor:pointer;font-size:.9rem;
  background:linear-gradient(135deg,#17489c,#123524);
}
.now-chat-send:hover{filter:brightness(1.08);}
.now-chat-quick{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.45rem;}
.now-chat-quick button{
  border:1px solid #dbe5de;background:#f6faf7;color:#3f5a4c;border-radius:999px;
  font-size:.7rem;font-weight:700;padding:.25rem .6rem;cursor:pointer;
}
.now-chat-quick button:hover{background:#e9f4ec;}

body.now-chat-open{overflow:hidden;}

@media (max-width:700px){
  .now-chat-panel{
    right:.5rem;left:.5rem;width:auto;
    bottom:calc(64px + 1.1rem + env(safe-area-inset-bottom));
    max-height:min(70vh,540px);
  }
  body[data-mobile="true"].now-chat-open{overflow:hidden;}
  body[data-mobile="true"] .now-chat-launcher{bottom:calc(90px + env(safe-area-inset-bottom,0px));}
}
