
/* ============================================================
   PURITAN AQUA CHATBOT — ALL STYLES (namespaced: .puritan-aqua / .pa-)
   ============================================================ */

/* ---------- ROOT / ISOLATION ---------- */
.puritan-aqua{
  --pa-primary:#0077B6;
  --pa-secondary:#00A8E8;
  --pa-accent:#48CAE4;
  --pa-deep:#023E8A;
  --pa-light:#EAF8FF;
  --pa-white:#FFFFFF;
  --pa-ink:#0B2C43;
  --pa-muted:#5B7C90;
  --pa-line:#D8ECF7;

  position: fixed;
  right: 15px;
  bottom: 20px;
  z-index: 999999;
  width: 0;
  height: 0;

  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--pa-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.puritan-aqua *,
.puritan-aqua *::before,
.puritan-aqua *::after{ box-sizing: border-box; }
.puritan-aqua button{ font: inherit; color: inherit; margin: 0; }
.puritan-aqua a{ text-decoration: none; }

.pa-sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}

/* ---------- FLOATING TOGGLE BUTTON ---------- */
.pa-chat-toggle{
  position:absolute; right:-20px; bottom:250px;
  width:45px; height:45px; border:0; border-radius:12px 0 0 12px;
  background:linear-gradient(140deg, var(--pa-secondary), var(--pa-primary) 55%, var(--pa-deep));
  color:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 10px 26px rgba(2,62,138,.35), 0 2px 6px rgba(0,0,0,.12);
  transition:transform .25s ease, box-shadow .25s ease;
  -webkit-tap-highlight-color:transparent;
}
.pa-chat-toggle:hover{ transform:translateY(-2px) scale(1.03); box-shadow:0 14px 32px rgba(2,62,138,.42); }
.pa-chat-toggle:active{ transform:translateY(0) scale(.97); }
.pa-chat-toggle:focus-visible{ outline:3px solid #7FDBFF; outline-offset:3px; }
.pa-chat-toggle svg{ width:30px; height:30px; display:block; }

.pa-chat-toggle__dot{
  position:absolute; top:6px; right:6px; width:14px; height:14px;
  border-radius:50%; background:#22C55E; border:2.5px solid #fff;
}
.pa-chat-toggle__dot::after{
  content:""; position:absolute; inset:-3px; border-radius:50%;
  border:2px solid rgba(34,197,94,.55);
  animation:paPing 2.6s ease-out infinite;
}
@keyframes paPing{
  0%{ transform:scale(.6); opacity:.9; }
  70%{ transform:scale(1.5); opacity:0; }
  100%{ transform:scale(1.5); opacity:0; }
}

.pa-chat-toggle__badge{
  position:absolute; top:-3px; left:-3px; min-width:20px; height:20px;
  padding:0 5px; border-radius:10px; background:#EF4444; color:#fff;
  font-size:11px; font-weight:700; line-height:1;
  display:flex; align-items:center; justify-content:center;
  border:2px solid #fff; box-shadow:0 2px 6px rgba(239,68,68,.4);
}
.pa-chat-toggle__badge[hidden]{ display:none !important; }

.pa-chat-toggle__tooltip{
  position:absolute; right:78px; top:50%;
  transform:translateY(-50%) translateX(6px);
  background:#023E8A; color:#fff; font-size:12.5px; font-weight:600;
  white-space:nowrap; padding:8px 12px; border-radius:10px;
  opacity:0; pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
  box-shadow:0 8px 20px rgba(2,62,138,.28);
}
.pa-chat-toggle__tooltip::after{
  content:""; position:absolute; right:-5px; top:50%; margin-top:-5px;
  border:5px solid transparent; border-left-color:#023E8A;
}
.pa-chat-toggle:hover .pa-chat-toggle__tooltip,
.pa-chat-toggle:focus-visible .pa-chat-toggle__tooltip{
  opacity:1; transform:translateY(-50%) translateX(0);
}

/* ---------- CHAT WINDOW ---------- */
.pa-chat-window{
  position:absolute; right:0; bottom:78px;
  width:380px;
  max-width:calc(100vw - 30px);
  height:min(720px, calc(100vh - 110px));
  height:min(720px, calc(100dvh - 110px));
  min-height:520px;
  max-height:720px;
  background:var(--pa-white);
  border:1px solid var(--pa-line);
  border-radius:20px;
  box-shadow:0 24px 60px rgba(2,62,138,.24), 0 4px 14px rgba(2,62,138,.10);
  display:flex; flex-direction:column; overflow:hidden;
  opacity:0; visibility:hidden; pointer-events:none;
  transform:translateY(14px) scale(.98);
  transform-origin:bottom right;
  transition:opacity .22s ease, transform .26s cubic-bezier(.22,.9,.3,1), visibility .22s;
}
.pa-chat-window.is-open{
  opacity:1; visibility:visible; pointer-events:auto;
  transform:translateY(0) scale(1);
}

/* ---------- HEADER ---------- */
.pa-chat-header{
  position:relative;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:14px 12px 14px 16px;
  background:linear-gradient(135deg, #023E8A 0%, #0077B6 55%, #00A8E8 100%);
  color:#fff; flex:0 0 auto;
}
.pa-chat-header::after{
  content:""; position:absolute; left:0; right:0; bottom:0; height:3px;
  background:linear-gradient(90deg, rgba(72,202,228,.15), rgba(72,202,228,.85), rgba(72,202,228,.15));
}
.pa-chat-header__brand{ display:flex; align-items:center; gap:11px; min-width:0; }
.pa-chat-header__logo{
  flex:0 0 auto; width: 80px;
  height: 55px; border-radius:12px;
  
  display:flex; align-items:center; justify-content:center;
}
.pa-chat-header__logo svg{ width:22px; height:22px; display:block; }
.pa-chat-header__text{ min-width:0; }
.pa-chat-header__title{
  margin:0; font-size:16px; font-weight:700; letter-spacing:.2px; line-height:1.2;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.pa-chat-header__subtitle{
  margin:1px 0 0; font-size:11.5px; font-weight:500;
  color:rgba(255,255,255,.82); line-height:1.2;
}
.pa-chat-header__actions{ display:flex; align-items:center; gap:8px; flex:0 0 auto; }

.pa-chat-status{
  display:inline-flex; align-items:center; gap:5px;
  font-size:11px; font-weight:700; letter-spacing:.3px;
  padding:4px 9px; border-radius:999px;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.22);
  color:#fff; white-space:nowrap;
}
.pa-chat-status__dot{
  width:7px; height:7px; border-radius:50%; background:#4ADE80;
  box-shadow:0 0 0 2px rgba(74,222,128,.25);
}

.pa-chat-close{
  width:34px; height:34px; border:0; border-radius:10px;
  background:transparent; color:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:background .18s ease, transform .18s ease;
}
.pa-chat-close:hover{ background:rgba(255,255,255,.18); }
.pa-chat-close:active{ transform:scale(.94); }
.pa-chat-close:focus-visible{ outline:2px solid #7FDBFF; outline-offset:2px; }
.pa-chat-close svg{ width:17px; height:17px; display:block; }

/* ---------- CHAT BODY ---------- */
.pa-chat-body{
  flex:1 1 auto;
  overflow-y:auto; overflow-x:hidden;
  padding:16px 14px 12px;
  background:linear-gradient(180deg, #F7FCFF 0%, #EAF8FF 100%);
  display:flex; flex-direction:column; gap:10px;
  scrollbar-width:thin; scrollbar-color:#B9E2F5 transparent;
  overscroll-behavior:contain;
}
.pa-chat-body::-webkit-scrollbar{ width:7px; }
.pa-chat-body::-webkit-scrollbar-thumb{ background:#B9E2F5; border-radius:8px; }
.pa-chat-body::-webkit-scrollbar-track{ background:transparent; }
.pa-chat-body:focus-visible{ outline:2px solid var(--pa-secondary); outline-offset:-2px; }

/* ---------- MESSAGES ---------- */
.pa-chat-message{
  display:flex; flex-direction:column;
  max-width:100%;
  animation:paFadeIn .28s ease both;
}
.pa-chat-message--bot{ align-items:flex-start; }
.pa-chat-message--user{ align-items:flex-end; }
.pa-chat-message--form{ align-items:stretch; width:100%; }

.pa-chat-bubble{
  max-width:88%;
  padding:10px 13px;
  border-radius:16px;
  font-size:14px;
  line-height:1.5;
  white-space:pre-line;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.pa-chat-message--bot .pa-chat-bubble{
  background:#fff;
  border:1px solid var(--pa-line);
  border-bottom-left-radius:6px;
  box-shadow:0 2px 8px rgba(2,62,138,.06);
}
.pa-chat-message--user .pa-chat-bubble{
  background:linear-gradient(135deg, var(--pa-secondary), var(--pa-primary));
  color:#fff;
  border-bottom-right-radius:6px;
  box-shadow:0 4px 12px rgba(0,119,182,.28);
}

@keyframes paFadeIn{
  from{ opacity:0; transform:translateY(6px); }
  to{ opacity:1; transform:translateY(0); }
}

/* ---------- TYPING INDICATOR ---------- */
.pa-chat-typing{
  display:inline-flex; align-items:center; gap:5px;
  padding:13px 15px;
}
.pa-chat-typing span{
  width:7px; height:7px; border-radius:50%; background:#8FC7E3;
  animation:paTyping 1.2s infinite ease-in-out;
}
.pa-chat-typing span:nth-child(2){ animation-delay:.16s; }
.pa-chat-typing span:nth-child(3){ animation-delay:.32s; }
@keyframes paTyping{
  0%,60%,100%{ transform:translateY(0); opacity:.45; }
  30%{ transform:translateY(-4px); opacity:1; }
}

/* ---------- QUICK ACTION BUTTONS ---------- */
.pa-chat-quick-row{
  display:flex; flex-wrap:wrap; gap:7px;
  margin-top:9px; max-width:100%;
}
.pa-chat-quick-btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:7px 12px; min-height:34px;
  border-radius:999px;
  border:1px solid #BEE3F5;
  background:#fff;
  color:var(--pa-primary);
  font-size:12.5px; font-weight:600; line-height:1.2;
  text-align:center; cursor:pointer;
  transition:background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
  -webkit-tap-highlight-color:transparent;
}
.pa-chat-quick-btn:hover{
  background:var(--pa-primary); color:#fff; border-color:var(--pa-primary);
  transform:translateY(-1px);
}
.pa-chat-quick-btn:focus-visible{ outline:2px solid var(--pa-deep); outline-offset:2px; }
.pa-chat-quick-btn:disabled{ opacity:.5; cursor:default; transform:none; background:#fff; color:var(--pa-primary); }

/* ---------- CONTACT CARD ---------- */
.pa-chat-card{ display:flex; flex-direction:column; gap:8px; }
.pa-chat-card__title{ font-weight:800; color:var(--pa-deep); font-size:14px; }
.pa-chat-card__row{ display:flex; gap:8px; font-size:13px; line-height:1.45; }
.pa-chat-card__label{ min-width:58px; font-weight:700; color:#2C5B77; flex:0 0 auto; }
.pa-chat-card__row a{ color:var(--pa-primary); word-break:break-word; }
.pa-chat-card__row a:hover{ text-decoration:underline; }

/* ---------- ENQUIRY FORM ---------- */
.pa-chat-form{
  width:100%;
  background:#fff;
  border:1px solid var(--pa-line);
  border-radius:16px;
  padding:14px;
  display:flex; flex-direction:column; gap:10px;
  box-shadow:0 3px 12px rgba(2,62,138,.07);
}
.pa-chat-field{ display:flex; flex-direction:column; gap:4px; }
.pa-chat-field label{
  font-size:12px; font-weight:700; color:#2C5B77; letter-spacing:.1px;
}
.pa-chat-req{ color:#E11D48; }
.pa-chat-field input,
.pa-chat-field select,
.pa-chat-field textarea{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #CFE7F4;
  background:#F9FDFF;
  font-family:inherit;
  font-size:13.5px;
  color:var(--pa-ink);
  outline:none;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.pa-chat-field textarea{ min-height:72px; resize:vertical; }
.pa-chat-field input:focus,
.pa-chat-field select:focus,
.pa-chat-field textarea:focus{
  border-color:var(--pa-secondary); background:#fff;
  box-shadow:0 0 0 3px rgba(0,168,232,.14);
}
.pa-chat-field.has-error input,
.pa-chat-field.has-error select,
.pa-chat-field.has-error textarea{
  border-color:#E11D48; background:#FFF7F9;
}
.pa-chat-error{ font-size:11.5px; color:#E11D48; line-height:1.3; }
.pa-chat-error:empty{ display:none; }

.pa-chat-turnstile{ display:flex; justify-content:center; width:100%; min-height:0; }
.pa-chat-turnstile:empty{ display:none; }
.pa-chat-turnstile__note{
  font-size:11.5px; color:#8A6D3B; background:#FFF8E5;
  border:1px solid #F2E0B5; border-radius:10px; padding:9px 11px;
  line-height:1.4; text-align:left; width:100%;
}

.pa-chat-form__note{
  font-size:12px; color:#E11D48; background:#FFF5F7;
  border:1px solid #FBD5DE; border-radius:10px; padding:9px 11px;
  line-height:1.4;
}
.pa-chat-form__note:empty{ display:none; }

.pa-chat-submit{
  width:100%; min-height:46px; margin-top:2px;
  border:0; border-radius:12px; cursor:pointer;
  background:linear-gradient(135deg, #00A8E8, #0077B6 60%, #023E8A);
  color:#fff; font-size:14px; font-weight:700; letter-spacing:.2px;
  box-shadow:0 8px 20px rgba(0,119,182,.3);
  transition:transform .18s ease, filter .18s ease, opacity .18s ease;
}
.pa-chat-submit:hover:not(:disabled){ transform:translateY(-1px); filter:brightness(1.05); }
.pa-chat-submit:active:not(:disabled){ transform:translateY(0); }
.pa-chat-submit:focus-visible{ outline:3px solid #7FDBFF; outline-offset:2px; }
.pa-chat-submit:disabled{ opacity:.7; cursor:progress; }

/* ============================================================
   CHAT COMPOSER — INPUT + SEND BUTTON
   ============================================================ */

.pa-chat-composer{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  padding:10px 12px;
  background:#fff;
  border-top:1px solid var(--pa-line);
}

/* Input holder */
.pa-chat-input{
  flex:1 1 auto;
  min-width:0;
  width:100%;
  height:44px;
  padding:0 14px;

  border:1px solid #CFE7F4;
  border-radius:12px;

  background:#F7FCFF;
  color:var(--pa-ink);

  font-family:inherit;
  font-size:14px;
  line-height:44px;

  outline:none;

  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.pa-chat-input::placeholder{
  color:#8AA9BC;
}

.pa-chat-input:focus{
  border-color:var(--pa-secondary);
  background:#fff;
  box-shadow:0 0 0 3px rgba(0,168,232,.15);
}

/* Send button beside input */
.pa-chat-send{
  flex:0 0 44px;
  width:44px;
  height:44px;

  padding:0;
  border:0;
  border-radius:12px;

  cursor:pointer;

  background:linear-gradient(
    135deg,
    var(--pa-secondary),
    var(--pa-primary)
  );

  color:#fff;

  display:flex;
  align-items:center;
  justify-content:center;

  box-shadow:0 6px 16px rgba(0,119,182,.30);

  transition:
    transform .18s ease,
    filter .18s ease,
    box-shadow .18s ease;
}

.pa-chat-send:hover{
  transform:translateY(-1px);
  filter:brightness(1.06);
  box-shadow:0 8px 20px rgba(0,119,182,.36);
}

.pa-chat-send:active{
  transform:translateY(0);
}

.pa-chat-send:focus-visible{
  outline:3px solid #7FDBFF;
  outline-offset:2px;
}

.pa-chat-send:disabled{
  opacity:.7;
  cursor:progress;
  transform:none;
}

.pa-chat-send svg{
  width:19px;
  height:19px;
  display:block;
}
/* ---------- RESPONSIVE ---------- */
@media (max-width:480px){
  .puritan-aqua{ right:10px; bottom:10px; }
  .pa-chat-window{
    right:0; bottom:80px;
    width:calc(100vw - 20px);
    max-width:calc(100vw - 20px);
    height:calc(100vh - 96px);
    height:calc(100dvh - 96px);
    max-height:calc(100dvh - 96px);
    min-height:0;
    border-radius:18px;
  }
  .pa-chat-toggle{ width:45px; height:45px; }
  .pa-chat-toggle svg{ width:27px; height:27px; }
  .pa-chat-toggle__tooltip{ display:none; }
  .pa-chat-bubble{ max-width:92%; font-size:13.5px; }
  .pa-chat-quick-btn{ font-size:12px; padding:7px 11px; }
  .pa-chat-status{ display:none; }
}
@media (max-width:360px){
  .pa-chat-quick-row{ gap:6px; }
  .pa-chat-quick-btn{ font-size:11.5px; padding:6px 10px; }
}
@media (max-height:640px){
  .pa-chat-window{ min-height:0; height:calc(100dvh - 100px); }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce){
  .puritan-aqua *,
  .puritan-aqua *::before,
  .puritan-aqua *::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
}





/* ============================================================
   PURITAN AQUA — FORCE INPUT + SEND BUTTON SAME ROW
   ============================================================ */

.puritan-aqua .pa-chat-composer{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:stretch !important;
  gap:8px !important;

  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;

  padding:10px 12px !important;
  margin:0 !important;

  background:#fff;
  border-top:1px solid var(--pa-line);
}

/* INPUT */
.puritan-aqua .pa-chat-composer .pa-chat-input{
  display:block !important;
  flex:1 1 auto !important;
  flex-grow:1 !important;
  flex-shrink:1 !important;
  flex-basis:0 !important;

  width:auto !important;
  max-width:none !important;
  min-width:0 !important;

  height:44px !important;
  margin:0 !important;

  box-sizing:border-box !important;
}

/* SEND BUTTON */
.puritan-aqua .pa-chat-composer .pa-chat-send{
  display:flex !important;
  flex:0 0 44px !important;
  flex-grow:0 !important;
  flex-shrink:0 !important;
  flex-basis:44px !important;

  width:44px !important;
  min-width:44px !important;
  max-width:44px !important;

  height:44px !important;
  min-height:44px !important;
  max-height:44px !important;

  margin:0 !important;
  padding:0 !important;

  position:relative !important;
  float:none !important;
  clear:none !important;

  align-items:center !important;
  justify-content:center !important;

  box-sizing:border-box !important;
}

/* SVG */
.puritan-aqua .pa-chat-composer .pa-chat-send svg{
  display:block !important;
  width:19px !important;
  height:19px !important;
  margin:0 !important;
  flex:none !important;
}