/* Базовый каркас гостевого лендинга (mobile-first). Темы переопределяют палитру/формы. */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100%;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.bg-layer::after { content: ""; position: absolute; inset: 0; }

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.site-header .logo {
  grid-column: 1;
  justify-self: start;
  height: 44px;
  max-width: 180px;
  width: auto;
  object-fit: contain;
}
.site-header .spacer { display: none; }
.header-contacts {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  max-width: 100%;
}
.header-contacts .contact-btn {
  padding: 0.65rem 1.15rem;
  font-size: 0.92rem;
  border-radius: 10px;
  font-weight: 600;
}
.header-contacts .contact-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}
.lang-switch {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem;
  flex: 1;
  box-sizing: border-box;
}
.brand { text-align: center; margin-bottom: 1.5rem; max-width: 100%; }
.brand .logo { max-width: 180px; max-height: 110px; width: auto; height: auto; object-fit: contain; }
.site-title { margin: 0.5rem 0 0.25rem; font-size: 1.9rem; overflow-wrap: break-word; word-break: break-word; }
.site-description { margin: 0 auto; max-width: 46ch; opacity: 0.9; overflow-wrap: break-word; }

.content {
  margin-top: 1.25rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
  max-width: 100%;
}
.content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: 1rem 0;
}
.content pre, .content code {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Широкие вкладки контента на лендинге */
.content-tabs-wrap {
  margin: 1.5rem 0 1rem;
  width: 100%;
  max-width: 100%;
}
.content-tabs-nav {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 100%;
}
.content-tabs-nav::-webkit-scrollbar {
  display: none;
}
.content-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 120px;
  max-width: 280px;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  min-height: 40px;
  box-sizing: border-box;
  word-break: break-word;
  transition: transform 0.22s cubic-bezier(.2,.7,.3,1), background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  user-select: none;
}
.content-tab-btn:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.content-tab-btn:active {
  transform: translateY(0) scale(0.98);
}
.content-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}
.content-tab-pane {
  display: none;
  animation: tabFadeIn 0.22s ease-out;
}
.content-tab-pane.active {
  display: block;
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Спойлер — скрытый текст, раскрывается по клику */
.spoiler {
  background: rgba(88, 88, 108, 0.88);
  color: transparent;
  text-shadow: none;
  border-radius: 5px;
  padding: 0.05em 0.35em;
  cursor: pointer;
  user-select: none;
  transition: background 0.25s ease, color 0.25s ease;
}
.spoiler:not(.revealed),
.spoiler:not(.revealed) * {
  color: transparent !important;
  text-shadow: none !important;
}
.spoiler:not(.revealed) img {
  visibility: hidden;
}
.spoiler.revealed {
  background: rgba(120, 120, 140, 0.16);
  color: inherit;
  cursor: text;
  user-select: text;
}

.content p {
  margin: 0.35em 0;
  line-height: 1.45;
}
.content p:first-child { margin-top: 0; }
.content p:last-child { margin-bottom: 0; }
.content h1, .content h2, .content h3, .content h4 {
  margin: 0.85em 0 0.3em;
  line-height: 1.25;
}
.content ul, .content ol {
  margin: 0.35em 0;
  padding-left: 1.4rem;
}
.content li {
  margin: 0.15em 0;
  line-height: 1.45;
}
.content blockquote {
  margin: 0.7em 0;
  word-break: break-word;
}
.content img, .content iframe, .content video {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-sizing: border-box;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  min-height: 40px;
  transition: transform 0.22s cubic-bezier(.2,.7,.3,1), box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease, color 0.22s ease, filter 0.22s ease;
}
.contact-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.contact-btn:active {
  transform: translateY(0) scale(0.98);
}
.bot-link { text-align: center; margin-top: 2rem; max-width: 100%; }

.lang-switch { display: flex; gap: 0.4rem; }
.lang-switch .lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  border: 1px solid transparent;
  letter-spacing: 0.03em;
}
.lang-switch .lang-btn.active { font-weight: 700; }

/* Мини-флаги на чистом CSS (без картинок и emoji) */
.flag {
  display: inline-block;
  width: 22px;
  height: 15px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.25);
  flex: none;
}
.flag-uk { background: linear-gradient(180deg, #005bbb 50%, #ffd500 50%); }
.flag-ru { background: linear-gradient(180deg, #fff 33.4%, #0039a6 33.4% 66.7%, #d52b1e 66.7%); }
.flag-en {
  /* Union Jack: синее поле, белые и красные диагонали, белый и красный кресты */
  background:
    linear-gradient(90deg, transparent 42%, #c8102e 42% 58%, transparent 58%),
    linear-gradient(180deg, transparent 40%, #c8102e 40% 60%, transparent 60%),
    linear-gradient(90deg, transparent 34%, #fff 34% 66%, transparent 66%),
    linear-gradient(180deg, transparent 28%, #fff 28% 72%, transparent 72%),
    linear-gradient(to top right, transparent calc(50% - 1px), #c8102e calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(to top left, transparent calc(50% - 1px), #c8102e calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(to top right, transparent calc(50% - 3px), #fff calc(50% - 3px) calc(50% + 3px), transparent calc(50% + 3px)),
    linear-gradient(to top left, transparent calc(50% - 3px), #fff calc(50% - 3px) calc(50% + 3px), transparent calc(50% + 3px)),
    #012169;
}

.site-footer {
  padding: 1.5rem 1rem;
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.footer-contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  width: 100%;
  max-width: 100%;
}
.footer-contacts .contact-btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: 12px;
  min-height: 44px;
}
.footer-contacts .contact-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .site-header {
    grid-template-columns: 1fr auto;
    padding: 0.75rem 0.85rem;
    gap: 0.7rem;
  }
  .site-header .logo {
    grid-column: 1;
    grid-row: 1;
    height: 40px;
    max-width: 140px;
  }
  .lang-switch {
    grid-column: 2;
    grid-row: 1;
  }
  .header-contacts {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
  }
  .header-contacts .contact-btn {
    padding: 0.55rem 0.95rem;
    font-size: 0.88rem;
    min-height: 40px;
  }
  .site-footer {
    padding: 1.25rem 0.75rem;
  }
  .footer-contacts {
    gap: 0.5rem;
  }
  .footer-contacts .contact-btn {
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    min-height: 40px;
    flex: 1 1 auto;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0.65rem 0.65rem;
    gap: 0.55rem;
  }
  .site-header .logo {
    height: 36px;
    max-width: 120px;
  }
  .header-contacts {
    gap: 0.4rem;
  }
  .header-contacts .contact-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.84rem;
    min-height: 40px;
    flex: 1 1 auto;
  }
  .lang-switch {
    gap: 0.25rem;
  }
  .lang-switch .lang-btn {
    padding: 0.25rem 0.45rem;
    font-size: 0.75rem;
  }
  .flag {
    width: 18px;
    height: 12px;
  }
  .container {
    padding: 1.25rem 0.75rem;
  }
  .site-title {
    font-size: 1.5rem;
  }
  .site-description {
    font-size: 0.95rem;
  }
  .content-tab-btn {
    min-width: 80px;
    padding: 0.55rem 0.8rem;
    font-size: 0.86rem;
  }
}

@media (min-width: 720px) {
  .site-title { font-size: 2.6rem; }
  .container { padding: 3rem 2rem; }
}

/* --- PUSH: колокольчик «Получить бонус» и модалка-подсказка (независимы от темы) --- */
#push-bell {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  background: #ffb300;
  color: #3e2723;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
#push-bell .bell-icon {
  display: inline-block;
  font-size: 1.2rem;
  transform-origin: top center;
  animation: bell-swing 2.2s ease-in-out infinite;
}
@keyframes bell-swing {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(18deg); }
  20% { transform: rotate(-14deg); }
  30% { transform: rotate(10deg); }
  40% { transform: rotate(-6deg); }
  50% { transform: rotate(0deg); }
}
#push-bell:hover { background: #ffc233; }

@media (max-width: 768px) {
  #push-bell {
    top: auto;
    bottom: 16px;
    left: 16px;
    padding: 0.6rem;
    gap: 0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    justify-content: center;
  }
  #push-bell .bell-label {
    display: none;
  }
  body:has(.floating-chat-bottom_left) #push-bell,
  .floating-chat-bottom_left ~ #push-bell {
    bottom: 72px;
  }
}

#push-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 1rem;
}
#push-modal.open { display: flex; }
.push-modal-box {
  position: relative;
  background: #fff;
  color: #1f2933;
  border-radius: 14px;
  padding: 1.4rem 1.4rem 1.6rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: modal-up 0.25s ease-out;
}
@keyframes modal-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.push-modal-box h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.push-modal-box p { margin: 0 0 1rem; line-height: 1.5; }
.push-modal-box .contact-btn {
  background: #2563eb;
  color: #fff;
  width: 100%;
  text-align: center;
  cursor: pointer;
  border: 0;
  font-size: 1rem;
  padding: 0.75rem 1rem;
}
.push-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  background: none;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}
.push-modal-close:hover { color: #111; }

@media (min-width: 720px) {
  #push-modal { align-items: center; }
  #push-bell { left: 1.5rem; top: 1.5rem; }
}

/* --- Калькулятор ориентировочного заработка на лендинге (mobile-first) --- */
.calculator-card {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  max-width: 100%;
  box-sizing: border-box;
}
.calc-card-title {
  margin: 0 0 1.25rem;
  font-size: 1.4rem;
  text-align: center;
}
.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 560px) {
  .calc-grid { grid-template-columns: 1fr 1fr; }
}
.calc-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.calc-field label,
.calc-slider-header label,
.calc-days-group label {
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0.9;
}
.calc-select,
.calc-input-days {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
}
.calc-select option {
  background: #1e293b;
  color: #f8fafc;
}
.calc-slider-group {
  margin-bottom: 1.25rem;
}
.calc-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.calc-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
}
.calc-range {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
  margin: 0.5rem 0 0.25rem;
}
.calc-range-limits {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  opacity: 0.65;
}
.calc-days-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}
.calc-result-box {
  padding: 1.25rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  margin-top: 1rem;
}
.calc-result-label {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 0.35rem;
}
.calc-result-sum {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fbbf24;
}
.calc-action-wrap {
  margin-top: 1rem;
}
.calc-contact-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1.05rem;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.calc-contact-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

@media (max-width: 480px) {
  .calculator-card {
    padding: 1rem 0.75rem;
    margin-top: 1.5rem;
  }
  .calc-card-title {
    font-size: 1.2rem;
  }
  .calc-result-sum {
    font-size: 1.65rem;
  }
  .calc-contact-btn {
    width: 100%;
    padding: 0.75rem 1rem;
  }
}

/* --- Баннерная реклама (BannerSystem) на лендинге --- */
.ad-slot-wrap {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
  overflow: hidden;
}
.ad-slot-top {
  margin: 0.5rem auto 0;
}
.ad-slot-bottom {
  margin: 1.5rem auto 0.5rem;
}
/* Фича 022: слоты вынесены в изолированные фреймы (/ads/frame/:slot).
   Правила `[data-ad-slot]` больше не применяются к основному документу —
   этот атрибут теперь живёт внутри фрейма. */
.ad-frame {
  display: block;
  border: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.ad-frame-top,
.ad-frame-bottom {
  width: 100%;
  max-width: 728px;
  height: 90px;
}
/* Пустой слот не должен занимать вертикального места. Прежняя вёрстка держала
   min-height: 90px, из-за чего при пустом ответе рекламной системы оставалась
   пустая полоса (правила `[data-ad-slot]:empty` в проекте никогда не было).
   Фрейм кросс-доменный и непрозрачный, поэтому родитель не может проверить его
   содержимое напрямую — пустоту сообщает сам фрейм через postMessage, а
   /js/ads-frames.js выставляет этот класс. */
.ad-slot-wrap.ad-empty,
.ad-slot-side.ad-empty {
  display: none !important;
}

.ad-slot-side {
  display: none;
}
.ad-frame-side {
  width: 160px;
  height: 600px;
}

@media (min-width: 1200px) {
  .ad-slot-side {
    display: block;
    position: fixed;
    top: 90px;
    width: 160px;
    min-height: 600px;
    z-index: 50;
  }
  .ad-slot-left {
    left: calc(50% - 430px - 160px - 16px);
  }
  .ad-slot-right {
    right: calc(50% - 430px - 160px - 16px);
  }
}

@media (max-width: 1199px) {
  /* Дублирует логику /js/ads-frames.js: скрипт не вставляет боковые фреймы
     ниже 1200 px, а это правило страхует случай отключённого JavaScript. */
  .ad-slot-side,
  .ad-slot-left,
  .ad-slot-right,
  .ad-frame-side {
    display: none !important;
  }
}

/* --- Floating Buttons on Landing Page --- */
.floating-chat-btn {
  position: fixed;
  bottom: 24px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 50px;
  background: var(--btn-bg, var(--biz-gold, var(--accent, #3b82f6)));
  color: var(--btn-color, var(--biz-bg, #ffffff));
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(10px);
}

.floating-chat-bottom_right {
  right: 24px;
}

.floating-chat-bottom_left {
  left: 24px;
}

.floating-chat-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.floating-chat-icon {
  font-size: 18px;
  line-height: 1;
}

.chat-btn-icon {
  font-size: 16px;
  line-height: 1;
  display: inline-block;
  margin-right: 4px;
}

@media (max-width: 600px) {
  .floating-chat-btn {
    bottom: 16px;
    padding: 12px;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    justify-content: center;
    box-sizing: border-box;
  }
  .floating-chat-bottom_right { right: 16px; }
  .floating-chat-bottom_left { left: 16px; }
  .floating-chat-label { display: none; }
}
