:root {
  --brand: #6a5cff;
  --brand-2: #9b5cff;
  --brand-dark: #4b3fd6;
  --bg: #eef0f6;
  --card: #ffffff;
  --bot-bubble: #f1f2f7;
  --bot-text: #1f2330;
  --user-bubble: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  --user-text: #ffffff;
  --muted: #8a90a2;
  --border: #e6e8f0;
  --shadow: 0 18px 50px rgba(40, 38, 90, 0.18);
  --radius: 18px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 80% -10%, #d9d4ff 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #ffe1f3 0%, transparent 55%),
              var(--bg);
  color: var(--bot-text);
}

.page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ---------- Chat card ---------- */
.chat {
  width: 100%;
  max-width: 440px;
  height: min(720px, 92vh);
  background: var(--card);
  border-radius: 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
}

.chat__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.chat__avatar img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  display: block;
}

.chat__title {
  font-size: 17px;
  margin: 0;
  font-weight: 700;
  line-height: 1.1;
}

.chat__status {
  font-size: 12.5px;
  opacity: 0.92;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat__status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5be08a;
  box-shadow: 0 0 0 3px rgba(91, 224, 138, 0.3);
}

/* ---------- Body / messages ---------- */
.chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 135px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafbff;
}

.chat__body::-webkit-scrollbar {
  width: 8px;
}
.chat__body::-webkit-scrollbar-thumb {
  background: #d8dbe8;
  border-radius: 8px;
}

.msg {
  display: flex;
  max-width: 85%;
  animation: pop 0.22s ease;
}

.msg--bot {
  align-self: flex-start;
}

.msg--user {
  align-self: flex-end;
  justify-content: flex-end;
}

.bubble {
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: 14.5px;
  line-height: 1.5;
  word-wrap: break-word;
}

.msg--bot .bubble {
  background: var(--bot-bubble);
  color: var(--bot-text);
  border-bottom-left-radius: 5px;
}

.msg--user .bubble {
  background: var(--user-bubble);
  color: var(--user-text);
  border-bottom-right-radius: 5px;
}

.bubble a {
  color: var(--brand-dark);
  font-weight: 600;
}
.msg--user .bubble a {
  color: #fff;
}

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

/* ---------- Typing indicator ---------- */
.typing .bubble {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 14px 16px;
}
.typing .bubble span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b6bace;
  animation: blink 1.2s infinite ease-in-out;
}
.typing .bubble span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing .bubble span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes blink {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* ---------- Links inside service info ---------- */
.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--bot-text);
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.link-btn__icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}
.link-btn:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  transform: translateX(2px);
}

/* ---------- Przycisk "zadzwoń" (infolinia czynna) ---------- */
.call-wrap {
  margin-top: 10px;
}

/* Zagnieżdżone w .bubble, żeby wygrać z regułą koloru dla ".bubble a". */
.bubble .call-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #17b26a 0%, #0e9f5e 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(14, 159, 94, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bubble .call-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(14, 159, 94, 0.36);
}
.bubble .call-btn:active {
  transform: translateY(0);
}

.call-btn__icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  animation: callPulse 2.4s ease-in-out infinite;
}
.call-btn__icon svg {
  width: 17px;
  height: 17px;
  fill: #fff;
  display: block;
}

.call-btn__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}
.call-btn__number {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.call-btn__hours {
  font-size: 11.5px;
  opacity: 0.92;
}

@keyframes callPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(255, 255, 255, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .call-btn__icon {
    animation: none;
  }
}

/* ---------- Footer (actions / input) ---------- */
.chat__footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
  min-height: 64px;
      position: fixed;
    bottom:0;
    right: 0;
    left: 0;
    max-width: 440px;
    margin-inline: auto;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 16px;
  border-radius: 14px;
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(106, 92, 255, 0.32);
}
.btn--primary:hover {
  box-shadow: 0 10px 26px rgba(106, 92, 255, 0.45);
}

.btn--ghost {
  background: #f2f3f9;
  color: var(--bot-text);
  width: 100%;
}
.btn--ghost:hover {
  background: #e9eaf5;
}

/* ---------- Input row ---------- */
.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(106, 92, 255, 0.15);
}

.btn--send {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .page {
    padding: 0;
  }
  .chat {
    height: 100vh;
    max-width: 100%;
    border-radius: 0;
  }
}
