/* ========== BUTTONS ========== */

/* Базовая кнопка — вторичная, спокойная */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 7px;
  border-radius: 10px;

  border: 1px solid var(--clr-border);
  background: var(--clr-surface);
  color: var(--clr-text);

  cursor: pointer;
  font-weight: 600;

  transition: transform 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: color-mix(in oklab, var(--accent-ghost) 40%, #fff 60%);
  border-color: color-mix(in oklab, var(--accent) 25%, var(--clr-border) 75%);
}

/* Фокус — брендовый, но не кричащий */
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ghost);
}

/* Скромная ghost */
.btn--ghost {
  background: transparent;
  color: var(--clr-muted);
  border-color: transparent;
}

.btn--ghost:hover {
  background: color-mix(in oklab, var(--accent-ghost) 35%, #fff 65%);
  color: var(--accent-strong);
}

/* === ГЛАВНАЯ КНОПКА КОНВЕРСИИ === */
.btn--accent {
  background: var(--accent);
  color: var(--btn-fg);
  border-color: transparent;

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18), 0 0 0 0 rgba(255, 124, 10, 0);

  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Яркий, "живой" hover */
.btn--accent:hover {
  background: var(--btn-bg-hover);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22), 0 0 0 4px var(--accent-ghost);
  transform: translateY(-1px);
}

/* Фокус для главной кнопки — сильнее остальных */
.btn--accent:focus-visible {
  box-shadow: 0 0 0 4px var(--accent-ghost),
    0 0 0 7px color-mix(in oklab, var(--accent) 40%, #fff 60%);
}

/* Reset */
.btn-reset {
  background: none;
  border: 0;
  color: var(--clr-text);
}

/* Анимации уважительно к «предпочтениям» */
@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}

/* ========== TG WIDGET ========== */
.tg-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
}

/* FAB */
.tg-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;

  background: var(--clr-surface);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);

  display: grid;
  place-items: center;
}

.tg-fab__icon {
  width: 26px;
  height: 26px;
  display: block;
}

/* Popup base */
.tg-popup {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 320px;

  background: var(--clr-surface);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);

  overflow: hidden;
  border: 1px solid var(--clr-border);

  transform: translateY(8px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

/* scale + fade */
.tg-popup.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.tg-popup__header {
  display: flex;
  align-items: center;
  padding: 14px 14px 12px;
  gap: 12px;
}

.tg-popup__brand {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent-ghost) 60%, #fff 40%);
  display: grid;
  place-items: center;
}

.tg-popup__logo {
  width: 22px;
  height: 22px;
  display: block;
}

.tg-popup__meta {
  flex: 1;
  min-width: 0;
}

.tg-popup__name {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  color: var(--clr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-popup__sub {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--clr-muted);
  font-size: 13px;
}

.tg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.tg-popup__close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--clr-text);
}

.tg-popup__close:hover {
  background: var(--accent-ghost);
}

/* Body */
.tg-popup__body {
  padding: 0 14px 14px;
}

.tg-popup__status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tg-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

/* онлайн — бренд + мягко */
.tg-badge--online {
  background: var(--accent-ghost);
  color: var(--accent-strong);
}

.tg-muted {
  font-size: 12px;
  color: var(--clr-muted);
}

.tg-popup__text {
  margin: 0;
  color: var(--clr-text);
  font-size: 14px;
  line-height: 1.35;
}

/* Footer */
.tg-popup__footer {
  padding: 12px 14px 14px;
}

.tg-popup__btn {
  display: block;
  text-align: center;

  background: var(--accent);
  color: var(--btn-fg);

  text-decoration: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
}

.tg-popup__btn:hover {
  background: var(--btn-bg-hover);
}

/* Mobile safe */
@media (max-width: 420px) {
  .tg-popup {
    width: calc(100vw - 48px);
  }
}
