/* ============================================================
   BIURODAL — WIDGET CZATU AI ("Kropka Dal")
   Wspólne style dla wszystkich podstron. HTML wstawia dal-chat.js.
   ============================================================ */

/* Kropka Dal: sage z śliwkowym środkiem (ok. 30% średnicy), jak w logo */
.dal-dot {
  display: block;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, #5d335c 0 30%, #9CAF88 calc(30% + 0.5px) 100%);
}

/* ---------- PRZYCISK: pigułka na komputerze, sama kropka na telefonie ---------- */
#dal-dot-launcher {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 9px 18px 9px 10px;
  background: #5d335c;
  border: 2px solid #9CAF88;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.18);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease;
  animation: dal-launch-in 0.4s ease-out both;
}
#dal-dot-launcher .dal-dot { width: 22px; height: 22px; }
#dal-dot-launcher:hover { background: #6e4470; }
#dal-dot-launcher:focus-visible { outline: 3px solid #ffb3cc; outline-offset: 3px; }
#dal-dot-launcher.hidden { display: none; }

@keyframes dal-launch-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* przycisk i dymek nad banerem cookies (wysokość banera liczy cookies.js) */
body.cookie-banner-open #dal-dot-launcher { bottom: var(--cookie-h, 26px); }

@media (max-width: 768px) {
  #dal-dot-launcher {
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 4px 15px rgba(0,0,0,0.22);
  }
  #dal-dot-launcher:hover { background: transparent; }
  #dal-dot-launcher .dal-dot { width: 56px; height: 56px; }
  #dal-dot-launcher .dal-launch-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap;
  }
}

/* ---------- DYMEK (tylko telefon) ---------- */
#dal-bubble {
  position: fixed;
  right: 16px;
  bottom: 88px;
  z-index: 10000;
  display: none;
  align-items: center;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid #ece6ec;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(93,51,92,0.18);
  font-family: 'Montserrat', sans-serif;
  animation: dal-launch-in 0.4s ease-out both;
}
#dal-bubble.show { display: flex; }
#dal-bubble::after {
  content: '';
  position: absolute;
  right: 26px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid #ece6ec;
  border-bottom: 1px solid #ece6ec;
  transform: rotate(45deg);
}
body.cookie-banner-open #dal-bubble { bottom: calc(var(--cookie-h, 20px) + 68px); }
.dal-bubble-text {
  background: none;
  border: none;
  margin: 0;
  padding: 12px 4px 12px 16px;
  min-height: 44px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #5d335c;
  text-align: left;
  cursor: pointer;
}
.dal-bubble-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: #777;
  cursor: pointer;
}
.dal-bubble-text:focus-visible, .dal-bubble-close:focus-visible { outline: 3px solid #ffb3cc; outline-offset: -3px; border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
  #dal-dot-launcher, #dal-bubble { animation: none; }
  #dal-dot-launcher { transition: none; }
}

/* ---------- OKNO CZATU (bez zmian) ---------- */
#dal-chat-window {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 90px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10001;
  border: 1px solid #e5e0e5;
  font-family: 'Montserrat', sans-serif;
}
#dal-chat-window.open { display: flex; min-height: 0; }

.dal-chat-head {
  background: #5D335C;
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dal-chat-head .dal-dot { width: 18px; height: 18px; }
.dal-chat-head-text { line-height: 1.3; }
.dal-chat-head-name { font-size: 0.85rem; font-weight: 700; }
.dal-chat-head-status { font-size: 0.7rem; color: rgba(255,255,255,0.7); }
.dal-chat-close {
  margin-left: auto;
  background: none; border: none; color: white;
  font-size: 1.3rem; cursor: pointer; line-height: 1; opacity: 0.8;
}
.dal-chat-close:hover { opacity: 1; }

.dal-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: #FCFAF6;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dal-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
}
.dal-msg.bot {
  background: white; border: 1px solid #eee;
  align-self: flex-start; border-bottom-left-radius: 3px; color: #222;
}
.dal-msg.user {
  background: #5D335C; color: white;
  align-self: flex-end; border-bottom-right-radius: 3px;
}
.dal-chat-input-row {
  display: flex; gap: 8px; padding: 10px;
  border-top: 1px solid #eee; background: white;
}
.dal-chat-input-row input {
  flex: 1; border: 1px solid #ddd; border-radius: 20px;
  padding: 9px 14px; font-size: 0.85rem; font-family: 'Montserrat', sans-serif; outline: none;
}
.dal-chat-input-row input:focus { border-color: #9CAF88; }
.dal-chat-note {
  padding: 6px 12px 9px; background: white; color: #6b6b6b;
  font-size: 0.7rem; line-height: 1.35; text-align: center;
}
.dal-msg-note {
  align-self: flex-start; max-width: 82%; margin-top: -4px;
  font-size: 0.7rem; line-height: 1.4; color: #6b6b6b;
}
.dal-msg-note a { color: #5D335C; text-decoration: underline; }
.dal-chat-send {
  background: #9CAF88; border: none; border-radius: 50%;
  width: 36px; height: 36px; cursor: pointer; flex-shrink: 0; font-size: 1rem;
}

@media (max-width: 480px) {
  #dal-chat-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 12px;
    top: 12px;
    height: auto;
    max-height: none;
  }
}
