body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background: #121212;
  color: #ddd;
}

/* Плавающая кнопка-контейнер */
#bs-open-popup {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  align-items: center;
  background-color: #1f1f1f;
  border: 1px solid #bbb;
  border-radius: 12px;
  color: #00ff66;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  padding: 10px 14px;
  user-select: none;
  overflow: hidden;
  width: 50px;
  height: 50px;
  transition: width 0.4s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: none;
}

#bs-open-popup .icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

#bs-open-popup .text {
  white-space: nowrap;
  margin-left: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  #bs-open-popup:hover {
    width: 190px;
    box-shadow:
      0 0 8px 1px rgba(0, 255, 102, 0.35),
      0 0 20px 4px rgba(0, 255, 102, 0.15);
    border-color: #00ff66;
  }
  #bs-open-popup:hover .text {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  #bs-open-popup {
    width: 50px !important;
    height: 50px !important;
    padding: 10px;
    border-radius: 12px;
  }
  #bs-open-popup .text {
    display: none !important;
  }
}

@keyframes slideOutIn {
  0%, 100% {
    width: 50px;
    box-shadow: none;
    border-color: #bbb;
  }
  50% {
    width: 180px;
    box-shadow:
      0 0 8px 1px rgba(0, 255, 102, 0.35),
      0 0 20px 4px rgba(0, 255, 102, 0.15);
    border-color: #00ff66;
  }
}

#bs-open-popup.mobile-slide {
  animation: slideOutIn 4s ease forwards;
}

@keyframes pulseGlow {
  0%, 20%, 50%, 70%, 100% {
    box-shadow: none;
    border-color: #bbb;
  }
  10%, 60% {
    box-shadow:
      0 0 12px 3px rgba(0, 255, 102, 0.4),
      0 0 25px 6px rgba(0, 255, 102, 0.15);
    border-color: #00ff66;
  }
}

#bs-open-popup.pulse {
  animation: pulseGlow 2s ease;
}

/* Стили для попапа */
#bs-popup {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9999;
  padding: 30px;
  box-sizing: border-box;
}
#bs-popup.bs-visible {
  visibility: visible;
  opacity: 1;
}

.bs-popup-backdrop {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.75);
  backdrop-filter: blur(3px);
  cursor: pointer;
  z-index: 1;
  opacity: 0;
  animation: fadeInBg 0.3s forwards;
}
@keyframes fadeInBg {
  to { opacity: 1; }
}

.bs-form-container {
  position: relative;
  z-index: 2;
  background-color: #222222;
  padding: 28px 24px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow:
    0 4px 12px rgba(0, 255, 102, 0.2),
    0 0 30px rgba(0, 255, 102, 0.15);
  border: 1px solid #bbb;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-20px);
  opacity: 0;
  animation: popupSlideIn 0.35s forwards;
  box-sizing: border-box;
}
#bs-popup.bs-visible .bs-form-container {
  animation: popupSlideIn 0.35s forwards;
}
@keyframes popupSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bs-form-container h3 {
  margin: 0 0 20px 0;
  color: #00ff66;
  text-align: center;
  user-select: none;
  font-weight: 600;
  font-size: 22px;
}

textarea, input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 14px;
  border: 1px solid #bbb;
  font-size: 16px;
  color: #eee;
  background-color: #333;
  resize: vertical;
  box-shadow: inset 0 0 8px rgba(0, 255, 102, 0.15);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  font-family: inherit;
  box-sizing: border-box;
}
textarea:focus, input:focus {
  outline: none;
  border-color: #00ff66;
  box-shadow:
    0 0 12px rgba(0, 255, 102, 0.5),
    inset 0 0 12px rgba(0, 255, 102, 0.25);
  background-color: #2a2a2a;
}

#bs-submit {
  background-color: #00ff66;
  color: #121212;
  border: none;
  border-radius: 14px;
  padding: 16px 26px;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  box-shadow:
    0 6px 10px rgba(0, 255, 102, 0.4);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}
#bs-submit:hover {
  background-color: #00cc55;
  box-shadow:
    0 8px 18px rgba(0, 255, 102, 0.7);
}

.bs-close {
  position: absolute;
  top: 12px; right: 16px;
  background: transparent;
  color: #66ff88;
  font-size: 28px;
  border: none;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}
.bs-close:hover {
  color: #00ff66;
}

#bs-error {
  display: none;
  background-color: #220000cc;
  color: #ff6666;
  border: 1.5px solid #ff4444;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  width: 100%;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 0 14px #ff5555aa;
  animation: fadeIn 0.3s ease;
  box-sizing: border-box;
}
@keyframes fadeIn {
  from {opacity: 0; transform: scale(0.95);}
  to {opacity: 1; transform: scale(1);}
}

/* Окно благодарности */
#bs-thanks-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  z-index: 11000;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  padding: 30px;
  box-sizing: border-box;
}
#bs-thanks-overlay.visible {
  visibility: visible;
  opacity: 1;
}

#bs-thanks-message {
  background-color: #222222;
  border-radius: 18px;
  padding: 28px 32px;
  box-shadow:
    0 6px 22px rgba(0, 255, 102, 0.25),
    0 0 30px rgba(0, 255, 102, 0.15);
  color: #00ff66;
  max-width: 400px;
  width: 100%;
  text-align: center;
  font-size: 18px;
  user-select: none;
  position: relative;
  line-height: 1.5;
  font-weight: 600;

  /* Тонкая светло-серая обводка */
  border: 1px solid #bbb;
}
#bs-thanks-message .info-text {
  font-weight: 400;
  font-size: 15px;
  color: #ccc;
  margin: 18px 0 24px 0;
  line-height: 1.3;
  user-select: text;
}

#bs-telegram-btn {
  background-color: #0088cc;
  border: none;
  border-radius: 14px;
  color: white;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 24px;
  cursor: pointer;
  user-select: none;
  box-shadow:
    0 6px 16px rgba(0, 136, 204, 0.45);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}
#bs-telegram-btn:hover {
  background-color: #0072b5;
  box-shadow:
    0 8px 24px rgba(0, 153, 255, 0.7);
}

.bs-thanks-close {
  position: absolute;
  top: 12px; right: 16px;
  background: transparent;
  border: none;
  color: #66ff88;
  font-size: 28px;
  cursor: pointer;
  user-select: none;
  transition: color 0.3s ease;
}
.bs-thanks-close:hover {
  color: #00ff66;
}

@media (max-width: 480px) {
  .bs-form-container,
  #bs-thanks-message {
    max-width: 100%;
    padding-left: 30px;
    padding-right: 30px;
  }
  #bs-submit {
    padding: 14px 20px;
    font-size: 16px;
  }
  textarea, input {
    font-size: 15px;
    padding: 12px 14px;
  }
}
