/* =========================================================
   PENTA AI PROPERTY ASSISTANT
   Pentagram Properties LLP
   ========================================================= */
:root{
  --penta-brand: var(--brand, #2a3587);
  --penta-gold: var(--gold, #C7A155);
  --penta-ink: #17202a;
  --penta-soft: #f6f7fb;
  --penta-white: #ffffff;
  --penta-shadow: 0 24px 65px rgba(20, 29, 70, .26);
}

.penta-assistant{
  position:fixed;
  right:clamp(14px, 2vw, 26px);
  bottom:175px;
  z-index:1085;
  font-family:var(--body, "Poppins", system-ui, sans-serif);
  color:var(--penta-ink);
}

.penta-launcher{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  min-height:64px;
  padding:7px 16px 7px 7px;
  border:1px solid rgba(42,53,135,.14);
  border-radius:999px;
  background:rgba(255,255,255,.97);
  color:var(--penta-brand);
  box-shadow:0 12px 34px rgba(14,24,67,.22);
  cursor:pointer;
  transition:transform .2s ease, box-shadow .2s ease;
  isolation:isolate;
}
.penta-launcher:hover{transform:translateY(-2px);box-shadow:0 17px 38px rgba(14,24,67,.28)}
.penta-launcher:focus-visible{outline:3px solid rgba(199,161,85,.6);outline-offset:3px}
.penta-launcher-img{
  width:52px;height:52px;object-fit:cover;object-position:50% 20%;
  border-radius:50%;background:#fff;border:2px solid rgba(199,161,85,.8);
}
.penta-launcher-copy{display:flex;flex-direction:column;align-items:flex-start;line-height:1.15;white-space:nowrap}
.penta-launcher-copy strong{font-size:.95rem;letter-spacing:.01em;color:var(--penta-brand)}
.penta-launcher-copy small{margin-top:3px;font-size:.7rem;color:#67707b;font-weight:600}
.penta-launcher-pulse{
  position:absolute;left:5px;top:5px;width:58px;height:58px;border-radius:50%;
  border:1px solid rgba(199,161,85,.55);z-index:-1;animation:pentaPulse 2.4s ease-out infinite;
}
@keyframes pentaPulse{0%{transform:scale(.85);opacity:.7}70%,100%{transform:scale(1.28);opacity:0}}

.penta-chat{
  position:absolute;
  right:0;
  bottom:78px;
  width:min(390px, calc(100vw - 28px));
  height:min(610px, calc(100vh - 210px));
  min-height:480px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius:22px;
  background:#fff;
  border:1px solid rgba(42,53,135,.11);
  box-shadow:var(--penta-shadow);
  transform:translateY(18px) scale(.97);
  transform-origin:bottom right;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .2s ease, transform .24s cubic-bezier(.2,.8,.2,1), visibility .2s;
}
.penta-chat.is-open{opacity:1;visibility:visible;pointer-events:auto;transform:none}

.penta-chat-head{
  flex:0 0 auto;display:flex;justify-content:space-between;align-items:center;
  padding:13px 14px 12px;
  background:linear-gradient(135deg, #20296e 0%, var(--penta-brand) 58%, #35429b 100%);
  color:#fff;border-bottom:2px solid rgba(199,161,85,.75);
}
.penta-chat-identity{display:flex;align-items:center;gap:10px;min-width:0}
.penta-chat-identity>span:last-child{display:flex;flex-direction:column;min-width:0}
.penta-chat-identity strong{font-size:1rem;color:#fff;letter-spacing:.03em}
.penta-chat-identity small{font-size:.68rem;color:rgba(255,255,255,.8);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.penta-online-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#55d98b;margin-right:4px;box-shadow:0 0 0 3px rgba(85,217,139,.15)}
.penta-avatar{width:45px;height:45px;overflow:hidden;border-radius:50%;background:#fff;border:2px solid var(--penta-gold);flex:0 0 auto}
.penta-avatar img{width:100%;height:100%;object-fit:cover;object-position:50% 17%;transform:scale(1.05)}
.penta-close{width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:50%;background:rgba(255,255,255,.1);color:#fff;font-size:1rem;cursor:pointer}
.penta-close:hover{background:rgba(255,255,255,.18)}

.penta-chat-body{
  flex:1 1 auto;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:16px 13px 10px;
  background:linear-gradient(180deg,#fbfbfe 0%,#f6f7fb 100%);
  scrollbar-width:thin;
  scrollbar-color:#c7cad6 transparent;
}
.penta-msg{display:flex;gap:8px;align-items:flex-end;margin:0 0 12px}
.penta-msg-avatar{width:30px;height:30px;overflow:hidden;border-radius:50%;background:#fff;border:1px solid rgba(42,53,135,.14);flex:0 0 auto}
.penta-msg-avatar img{width:100%;height:100%;object-fit:cover;object-position:50% 18%}
.penta-bubble{max-width:82%;padding:10px 12px;border-radius:16px;font-size:.86rem;line-height:1.5;box-shadow:0 4px 12px rgba(20,28,60,.06)}
.penta-bubble p{margin:0;color:inherit!important;font:inherit!important}
.penta-bubble p+p{margin-top:5px}
.penta-bot-msg .penta-bubble{background:#fff;color:#26313a;border:1px solid #e9eaf1;border-bottom-left-radius:5px}
.penta-user-msg{justify-content:flex-end}
.penta-user-msg .penta-bubble{background:var(--penta-brand);color:#fff;border-bottom-right-radius:5px}
.penta-user-msg .penta-bubble p{color:#fff!important}
.penta-error-msg .penta-bubble{background:#fff6f6;border-color:#ffd8d8;color:#8c2f2f}

.penta-quick-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:4px 0 14px 38px}
.penta-quick-actions button{
  display:flex;align-items:center;justify-content:flex-start;gap:6px;
  padding:9px 9px;border:1px solid rgba(42,53,135,.16);border-radius:11px;
  background:#fff;color:var(--penta-brand);font-size:.75rem;font-weight:700;cursor:pointer;
  transition:background .18s ease,transform .18s ease,border-color .18s ease;
}
.penta-quick-actions button:hover{background:#f0f2ff;border-color:rgba(42,53,135,.35);transform:translateY(-1px)}
.penta-quick-actions i{color:var(--penta-gold);font-size:.9rem}

.penta-typing{flex:0 0 auto;display:flex;align-items:center;gap:4px;padding:7px 15px;background:#f6f7fb;color:#737b86;font-size:.68rem;border-top:1px solid #eceef4}
.penta-typing[hidden]{display:none}
.penta-typing span{width:6px;height:6px;border-radius:50%;background:var(--penta-brand);opacity:.45;animation:pentaDot 1.2s infinite ease-in-out}
.penta-typing span:nth-child(2){animation-delay:.15s}.penta-typing span:nth-child(3){animation-delay:.3s}
.penta-typing small{margin-left:4px;font-size:.68rem}
@keyframes pentaDot{0%,80%,100%{transform:translateY(0);opacity:.35}40%{transform:translateY(-3px);opacity:1}}

.penta-chat-form{flex:0 0 auto;display:flex;align-items:flex-end;gap:8px;padding:10px;background:#fff;border-top:1px solid #eceef4}
.penta-chat-form textarea{
  flex:1;min-height:42px;max-height:104px;resize:none;overflow-y:auto;
  border:1px solid #dfe2ea;border-radius:14px;padding:10px 11px;
  background:#fafbfc;color:#202934;font-family:inherit;font-size:.83rem;line-height:1.35;outline:none;
}
.penta-chat-form textarea:focus{border-color:rgba(42,53,135,.55);box-shadow:0 0 0 3px rgba(42,53,135,.08)}
.penta-chat-form textarea::placeholder{color:#9198a2}
.penta-chat-form button{width:42px;height:42px;display:grid;place-items:center;flex:0 0 auto;border:0;border-radius:13px;background:var(--penta-brand);color:#fff;cursor:pointer;box-shadow:0 7px 16px rgba(42,53,135,.23)}
.penta-chat-form button:hover{filter:brightness(.96)}
.penta-chat-form button:disabled{opacity:.55;cursor:not-allowed}

.penta-chat-footer{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:6px;padding:7px 11px;background:#fff;border-top:1px solid #f0f1f4;font-size:.61rem}
.penta-chat-footer span{color:#89909a}
.penta-chat-footer a{color:#16884a;text-decoration:none;font-weight:800;white-space:nowrap}
.penta-chat-footer a:hover{text-decoration:underline}

@media (max-width:767.98px){
  .penta-assistant{right:12px;bottom:82px}
  .penta-launcher{min-height:58px;padding:6px}
  .penta-launcher-img{width:46px;height:46px}
  .penta-launcher-copy{display:none}
  .penta-launcher-pulse{left:3px;top:3px;width:52px;height:52px}
  .penta-chat{position:fixed;left:10px;right:10px;bottom:82px;width:auto;height:min(610px,calc(100vh - 100px));min-height:0;transform-origin:bottom center}
}
@media (max-height:650px) and (min-width:768px){.penta-assistant{bottom:90px}.penta-chat{height:480px;bottom:72px}}
@media (prefers-reduced-motion:reduce){.penta-launcher,.penta-chat,.penta-quick-actions button,.penta-launcher-pulse,.penta-typing span{transition:none!important;animation:none!important}}
@media print{.penta-assistant{display:none!important}}

/* ===== No-API guided flow additions ===== */
.penta-choice-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
  margin:4px 0 14px 38px;
}
.penta-choice-grid button{
  border:1px solid rgba(42,53,135,.16);
  border-radius:11px;
  background:#fff;
  color:var(--penta-brand);
  padding:9px 10px;
  text-align:left;
  font-size:.75rem;
  font-weight:700;
  cursor:pointer;
  transition:background .18s ease, transform .18s ease, border-color .18s ease;
}
.penta-choice-grid button:hover{
  background:#f0f2ff;
  border-color:rgba(42,53,135,.35);
  transform:translateY(-1px);
}
.penta-whatsapp-wrap{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin:4px 0 16px 38px;
}
.penta-whatsapp-btn,
.penta-reset-btn{
  border-radius:12px;
  padding:10px 12px;
  font-size:.78rem;
  font-weight:800;
  text-align:center;
  text-decoration:none;
}
.penta-whatsapp-btn{
  background:#25D366;
  color:#fff;
  border:1px solid #25D366;
}
.penta-whatsapp-btn:hover{color:#fff;filter:brightness(.96)}
.penta-reset-btn{
  background:#fff;
  color:var(--penta-brand);
  border:1px solid rgba(42,53,135,.2);
  cursor:pointer;
}
.penta-reset-btn:hover{background:#f5f6ff}

@media (max-width:420px){
  .penta-choice-grid{grid-template-columns:1fr;margin-left:38px}
}
