:root {
  --nhivf-purple: #5a3d91;
  --nhivf-pink: #d52b87;
  --nhivf-blue: #46b6cf;
  --nhivf-bg: #f7f8fb;
  --nhivf-text: #1e2330;
}

.nhivf-chat-toggle {
  position: fixed;
  right: 22px;
  bottom: 100px;
  z-index: 999998;
  width: 168px;
  height: 120px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  filter: drop-shadow(0 8px 14px rgba(50,30,80,.16));
}
.nhivf-assistant-avatar {
  width: 92px;
  height: 92px;
  object-fit: contain;
  display: block;
  transition: transform .2s ease;
}
.nhivf-chat-toggle:hover .nhivf-assistant-avatar { transform: translateY(-3px) scale(1.03); }
.nhivf-help-bubble {
  position: absolute;
  right: 76px;
  top: 2px;
  min-width: 98px;
  padding: 9px 13px 10px;
  border: 2px solid #df2d8b;
  border-radius: 17px;
  background: #fff;
  color: #4d3a67;
  font-size: 13px;
  line-height: 1.05;
  text-align: center;
  box-shadow: 0 7px 18px rgba(71,42,100,.14);
}
.nhivf-help-bubble::after {
  content: '';
  position: absolute;
  right: 11px;
  bottom: -9px;
  width: 15px;
  height: 15px;
  background: #fff;
  border-right: 2px solid #df2d8b;
  border-bottom: 2px solid #df2d8b;
  transform: rotate(45deg);
}
.nhivf-help-heart { color: #df2d8b; margin-right: 3px; font-size: 15px; }
.nhivf-help-bubble strong { color: #df2d8b; font-size: 18px; }
.nhivf-chat-toggle.hidden { display:none; }

.nhivf-chatbot {
  position: fixed;
  right: 22px;
  bottom: 175px;
  z-index: 999999;
  width: min(390px, calc(100vw - 24px));
  height: min(690px, calc(100vh - 34px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(31,25,55,.22);
  border: 1px solid rgba(90,61,145,.10);
}
.nhivf-chatbot.open { display:flex; }

.nhivf-chat-header {
  min-height: 78px;
  padding: 11px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:#fff;
  background: linear-gradient(135deg, var(--nhivf-purple), var(--nhivf-pink));
}
.nhivf-brand { display:flex; align-items:center; gap:10px; min-width:0; }
.nhivf-brand img { width:58px; height:42px; object-fit:contain; background:#fff; border-radius:8px; padding:2px; }
.nhivf-brand strong { display:block; font-size:16px; line-height:1.2; }
.nhivf-brand small { display:block; opacity:.9; margin-top:3px; font-size:11px; }
.nhivf-icon-btn { border:0; background:rgba(255,255,255,.15); color:#fff; width:34px; height:34px; border-radius:50%; font-size:23px; cursor:pointer; }

.nhivf-chat-messages {
  flex:1;
  overflow-y:auto;
  padding:14px;
  background: var(--nhivf-bg);
}
.nhivf-message {
  max-width: 92%;
  padding:12px 14px;
  margin:0 0 9px;
  border-radius:15px;
  font-size:14px;
  line-height:1.55;
  color:var(--nhivf-text);
  background:#fff;
  box-shadow:0 1px 5px rgba(30,35,48,.06);
}
.nhivf-message.user {
  margin-left:auto;
  background:#e9dff5;
  color:#3f286a;
  border-bottom-right-radius:5px;
}
.nhivf-buttons { display:flex; flex-wrap:wrap; gap:7px; margin:0 0 13px; }
.nhivf-option {
  flex:1 1 46%;
  min-height:39px;
  border:1px solid var(--nhivf-blue);
  border-radius:20px;
  background:#fff;
  color:#20242c;
  padding:8px 11px;
  font-size:13px;
  cursor:pointer;
  transition:.15s ease;
}
.nhivf-option:hover { background:#edfaff; transform:translateY(-1px); }

.nhivf-form-card {
  background:#fff;
  border-radius:15px;
  padding:14px;
  margin-bottom:14px;
  box-shadow:0 1px 7px rgba(30,35,48,.07);
}
.nhivf-form-card h3 { margin:0 0 5px; color:var(--nhivf-purple); font-size:17px; }
.nhivf-form-card p { margin:0 0 12px; font-size:13px; line-height:1.45; }
.nhivf-form-card label { display:block; margin:0 0 9px; font-size:12px; font-weight:600; color:#444; }
.nhivf-form-card input[type=text],
.nhivf-form-card input[type=tel],
.nhivf-form-card input[type=email] {
  width:100%; box-sizing:border-box; margin-top:5px; padding:10px 11px;
  border:1px solid #d8dbe4; border-radius:9px; outline:none; font-size:13px;
}
.nhivf-form-card input:focus { border-color:var(--nhivf-blue); }
.nhivf-consent { font-weight:400 !important; display:flex !important; gap:7px; align-items:flex-start; line-height:1.35; }
.nhivf-consent input { margin-top:2px; }
.nhivf-submit {
  width:100%; border:0; border-radius:10px; padding:11px;
  color:#fff; background:linear-gradient(135deg,var(--nhivf-purple),var(--nhivf-pink));
  font-weight:700; cursor:pointer;
}
.nhivf-submit:disabled { opacity:.6; cursor:default; }
.nhivf-form-status { margin-top:9px; font-size:12px; line-height:1.4; }
.nhivf-form-status.success { color:#1a7b4b; }
.nhivf-form-status.error { color:#b3261e; }

.nhivf-chat-footer {
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 10px;
  border-top:1px solid #ececf1;
  background:#fff;
}
.nhivf-small-btn { border:0; background:transparent; color:var(--nhivf-purple); font-size:12px; cursor:pointer; }
.nhivf-powered { font-size:10px; color:#8b8f9a; }

@media (max-width: 520px) {
  .nhivf-chatbot { right:10px; bottom:160px; width:calc(100vw - 20px); height:calc(100vh - 180px); max-height:calc(100vh - 180px); border-radius:15px; }
  .nhivf-chat-toggle { right:8px; bottom:92px; width:150px; height:108px; }
  .nhivf-assistant-avatar { width:82px; height:82px; }
  .nhivf-help-bubble { right:67px; top:0; min-width:88px; padding:8px 10px 9px; font-size:12px; }
  .nhivf-help-bubble strong { font-size:16px; }
  .nhivf-option { flex-basis:100%; }
}
