/* DigMa Systems — AI Chat Widget styles.
   Ported look-and-feel from step-seeds.de/bot-agent.de ChatWidget, recolored
   to DigMa's blue (#2d6cdf) / navy (#0f2a66) brand. */

#digma-chat-launcher{
  position:fixed;bottom:1rem;right:1.5rem;z-index:65;
  display:flex;align-items:center;gap:.5rem;
  padding:.85rem 1.35rem;border-radius:9999px;border:none;cursor:pointer;
  background:#2d6cdf;color:#fff;font-weight:600;font-size:.95rem;font-family:inherit;
  box-shadow:0 8px 24px rgba(45,108,223,.3);
  opacity:0;transform:translateY(16px);pointer-events:none;
  transition:transform .2s,box-shadow .2s,background .2s;
  animation:digma-chat-glow 2.4s ease-in-out infinite;
}
#digma-chat-launcher.is-visible{opacity:1;transform:translateY(0);pointer-events:auto;animation-name:digma-chat-glow,digma-chat-slide-in;animation-duration:2.4s,.35s;animation-iteration-count:infinite,1;animation-timing-function:ease-in-out,ease-out}
#digma-chat-launcher:hover{background:#1d4ed8;transform:translateY(-2px)}
#digma-chat-launcher svg{width:20px;height:20px;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;fill:none}
@keyframes digma-chat-glow{0%,100%{box-shadow:0 8px 24px rgba(45,108,223,.3)}50%{box-shadow:0 8px 30px rgba(45,108,223,.55)}}
@keyframes digma-chat-slide-in{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}

#digma-chat-panel{
  position:fixed;bottom:1rem;right:1.5rem;z-index:65;
  width:min(400px,calc(100vw - 2.5rem));height:min(600px,calc(100vh - 2.5rem));
  background:#fff;border-radius:16px;border:1.5px solid #2d6cdf;
  box-shadow:0 25px 60px rgba(15,42,102,.25);
  display:none;flex-direction:column;overflow:hidden;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
}
#digma-chat-panel.is-open{display:flex;animation:digma-chat-slide-in .3s ease-out}

#digma-chat-drag-handle{height:10px;background:rgba(15,42,102,.95);flex-shrink:0;position:relative;cursor:ns-resize;touch-action:none}
#digma-chat-drag-handle::before{content:"";position:absolute;top:3px;left:50%;transform:translateX(-50%);width:36px;height:4px;border-radius:9999px;background:rgba(255,255,255,.35)}

#digma-chat-consent{display:none;flex-direction:column;gap:.9rem;padding:1.5rem;flex:1;overflow-y:auto}
#digma-chat-conversation{display:none;flex-direction:column;flex:1;min-height:0}
#digma-chat-consent h3{margin:0;font-size:1.05rem;font-weight:700;color:#0f2a66}
#digma-chat-consent p{margin:0;font-size:.85rem;color:#4b5563;line-height:1.55}
#digma-chat-consent p a{color:#2d6cdf}
#digma-chat-consent-accept{margin-top:.3rem;padding:.75rem 1rem;border:none;border-radius:9999px;background:#2d6cdf;color:#fff;font-weight:600;font-size:.9rem;cursor:pointer;font-family:inherit}
#digma-chat-consent-accept:hover{background:#1d4ed8}

#digma-chat-header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.9rem 1.1rem;background:#0f2a66;color:#fff;flex-shrink:0}
#digma-chat-header-left{display:flex;align-items:center;gap:.65rem;min-width:0}
#digma-chat-avatar{flex-shrink:0;width:32px;height:32px;border-radius:50%;background:rgba(96,165,250,.18);display:flex;align-items:center;justify-content:center}
#digma-chat-avatar svg{width:18px;height:18px;stroke:#60a5fa;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;fill:none}
#digma-chat-header-info{display:flex;flex-direction:column;gap:.1rem;min-width:0}
#digma-chat-title{font-weight:700;font-size:.95rem}
#digma-chat-subtitle{font-size:.68rem;color:#b8c4d9}
#digma-chat-subtitle a{color:#60a5fa;text-decoration:none;padding-left:.25rem}
#digma-chat-close{background:transparent;border:none;color:#fff;cursor:pointer;padding:.25rem;line-height:0;flex-shrink:0}
#digma-chat-close svg{width:18px;height:18px;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;fill:none}

#digma-chat-messages{flex:1;overflow-y:auto;padding:1rem;background:#f8fafc;display:flex;flex-direction:column;gap:.65rem}
.digma-chat-bubble{max-width:85%;padding:.65rem .9rem;border-radius:16px;font-size:.88rem;line-height:1.5;word-wrap:break-word}
.digma-chat-bubble p{margin:0 0 .4rem}
.digma-chat-bubble p:last-child{margin-bottom:0}
.digma-chat-bubble ul{margin:.3rem 0;padding-left:1.1rem}
.digma-chat-bubble a{text-decoration:none;color:#fff}
.digma-chat-user{align-self:flex-end;background:#0f2a66;color:#fff;border-bottom-right-radius:4px}
.digma-chat-bot{align-self:flex-start;background:#fff;color:#1f2937;border:1px solid #e2e8f0;border-bottom-left-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.digma-chat-cta{display:inline-block;margin-top:.6rem;padding:.4rem .8rem;background:#2d6cdf;color:#fff;border-radius:9999px;font-size:.78rem;font-weight:600;text-decoration:none}
.digma-chat-typing{display:flex;gap:.3rem;align-items:center;padding:.75rem .9rem}
.digma-chat-typing span{width:6px;height:6px;border-radius:50%;background:#94a3b8;animation:digma-chat-bounce 1.2s infinite}
.digma-chat-typing span:nth-child(2){animation-delay:.15s}
.digma-chat-typing span:nth-child(3){animation-delay:.3s}
@keyframes digma-chat-bounce{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-4px);opacity:1}}

#digma-chat-form{display:flex;gap:.5rem;padding:.85rem;border-top:1px solid #e2e8f0;background:#fff;flex-shrink:0}
#digma-chat-input{flex:1;padding:.6rem .85rem;border:1px solid #e2e8f0;border-radius:10px;font-size:.88rem;font-family:inherit;outline:none;transition:border-color .15s}
#digma-chat-input:focus{border-color:#2d6cdf}
#digma-chat-send{flex-shrink:0;width:38px;height:38px;border-radius:10px;border:none;background:#2d6cdf;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center}
#digma-chat-send:disabled{opacity:.4;cursor:not-allowed}
#digma-chat-send svg{width:17px;height:17px;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;fill:none}

#digma-chat-footer{padding:.4rem .85rem .5rem;text-align:center;border-top:1px solid #e2e8f0;flex-shrink:0;background:#fff}
#digma-chat-footer-brand{display:block;font-size:.7rem;color:#9ca3af;margin-bottom:-.25rem;text-decoration:none}
#digma-chat-footer-brand:hover{color:#2d6cdf}
#digma-chat-footer-cta{display:inline-block;font-size:.78rem;color:#2d6cdf;font-weight:600;text-decoration:none}
#digma-chat-footer-cta:hover{text-decoration:underline}

@media(max-width:480px){
  #digma-chat-panel{right:.75rem;left:.75rem;width:auto;bottom:.75rem}
  #digma-chat-launcher{right:.75rem;bottom:.75rem}
}
