/* ─────────────────────────────────────────────────────────────────
   CTA-компоненты призывов к регистрации.
   Использует токены из tokens.css. Поддерживает темы dark/light.
   ───────────────────────────────────────────────────────────────── */

.cta-btn {
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: .9em;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
  font-family: inherit;
  white-space: nowrap;
}
.cta-btn-primary {
  background: var(--success);
  color: var(--text-on-dark);
  padding: 10px 18px;
}
.cta-btn-primary:hover { background: #2ea043; transform: translateY(-1px); }
.cta-btn-link {
  background: transparent;
  color: var(--accent);
  padding: 10px 14px;
}
.cta-btn-link:hover { color: var(--accent-hover); text-decoration: underline; }
.cta-btn-sm { font-size: .82em; padding: 7px 12px; }

/* ── 1. МОДАЛ НА ИЗБРАННОЕ ─────────────────────────────────────── */
.cta-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10500;
  opacity: 0;
  transition: opacity .2s ease;
}
.cta-overlay.is-open { opacity: 1; }
.cta-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 16px;
  padding: 28px 24px 24px;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  transform: translateY(8px) scale(.98);
  transition: transform .2s ease;
}
.cta-overlay.is-open .cta-modal { transform: translateY(0) scale(1); }
.cta-modal-close {
  position: absolute; top: 8px; right: 12px;
  background: transparent; border: none;
  color: var(--text-muted);
  font-size: 22px; line-height: 1;
  cursor: pointer; padding: 4px 10px; border-radius: 4px;
  transition: color .15s, background .15s;
}
.cta-modal-close:hover { color: var(--text); background: var(--bg-3); }
.cta-modal-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
}
.cta-modal-icon svg { width: 100%; height: 100%; }
.cta-icon-star { color: #ffd700; }
.cta-modal-title {
  font-size: 1.2em; font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.cta-modal-desc {
  font-size: .92em;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}
.cta-modal-actions {
  display: flex; gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── 2. SOFT BANNER (под результатом расчёта) ──────────────────── */
.cta-soft-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 44px 14px 16px;
  margin: 12px 0 16px;
  background: linear-gradient(135deg, var(--accent-bg) 0%, var(--success-bg) 100%);
  border: 1px solid var(--success-border);
  border-radius: 10px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .25s ease, transform .25s ease;
}
.cta-soft-banner.is-open { opacity: 1; transform: translateY(0); }
.cta-soft-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  color: var(--accent);
}
.cta-soft-icon svg { width: 100%; height: 100%; }
.cta-soft-text { flex: 1; min-width: 200px; }
.cta-soft-title {
  font-size: .95em; font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.cta-soft-desc {
  font-size: .85em;
  color: var(--text-muted);
  line-height: 1.4;
}
.cta-soft-cta { flex-shrink: 0; }
.cta-soft-close {
  position: absolute; top: 8px; right: 10px;
  background: transparent; border: none;
  color: var(--text-muted);
  font-size: 18px; line-height: 1;
  cursor: pointer; padding: 4px 8px; border-radius: 4px;
}
.cta-soft-close:hover { color: var(--text); background: var(--bg-3); }

/* ── 3. INLINE CARD (в сайдбаре) ───────────────────────────────── */
.cta-inline {
  position: relative;
  padding: 14px 12px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  opacity: 0;
  transition: opacity .2s ease;
}
.cta-inline.is-open { opacity: 1; }
.cta-inline-close {
  position: absolute; top: 4px; right: 6px;
  background: transparent; border: none;
  color: var(--text-subtle);
  font-size: 16px; line-height: 1;
  cursor: pointer; padding: 4px 6px;
}
.cta-inline-close:hover { color: var(--text); }
.cta-inline-icon {
  width: 28px; height: 28px;
  margin: 0 auto 8px;
  color: var(--accent);
}
.cta-inline-icon svg { width: 100%; height: 100%; }
.cta-inline-title {
  font-size: .88em; font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.cta-inline-desc {
  font-size: .78em;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}
.cta-inline-actions {
  display: flex; flex-direction: column; gap: 6px;
}

/* ── 4. TOAST (после смены темы/языка) ─────────────────────────── */
.cta-toast {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  z-index: 10400;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .25s ease, transform .25s ease;
}
.cta-toast.is-open { opacity: 1; transform: translateX(0); }
.cta-toast-icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  color: var(--accent);
  margin-top: 2px;
}
.cta-toast-icon svg { width: 100%; height: 100%; }
.cta-toast-body { flex: 1; min-width: 0; }
.cta-toast-text {
  font-size: .85em;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
}
.cta-toast-cta {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 5px 12px;
  font-size: .82em; font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.cta-toast-cta:hover { background: var(--accent); color: var(--text-on-dark); }
.cta-toast-close {
  flex-shrink: 0;
  background: transparent; border: none;
  color: var(--text-muted);
  font-size: 18px; line-height: 1;
  cursor: pointer; padding: 0 4px;
}
.cta-toast-close:hover { color: var(--text); }

/* ── 5. STICKY DONATE FOOTER ───────────────────────────────────── */
.cta-sticky {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1050;
  background: var(--bg-2, #161b22);
  border-top: 1px solid var(--border, #30363d);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 280ms ease, opacity 280ms ease;
  pointer-events: none;
}
.cta-sticky.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cta-sticky-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cta-sticky-icon { font-size: 18px; flex-shrink: 0; }
.cta-sticky-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted, #8b949e);
  min-width: 0;
}
.cta-btn-donate {
  background: var(--gold, #e3a341);
  color: #000;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: .82em;
  transition: filter .15s;
}
.cta-btn-donate:hover { filter: brightness(1.1); color: #000; text-decoration: none; }
.cta-sticky-close {
  flex-shrink: 0;
  background: transparent; border: none;
  color: var(--text-subtle, #6e7681);
  font-size: 18px; line-height: 1;
  cursor: pointer; padding: 0 4px;
  transition: color .15s;
}
.cta-sticky-close:hover { color: var(--text, #e6edf3); }

/* ── 6. TOPBAR REGISTER STRIP ──────────────────────────────────── */
.cta-topbar {
  background: var(--bg-2, #161b22);
  border-bottom: 1px solid var(--border, #30363d);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 250ms ease, transform 250ms ease;
  pointer-events: none;
}
.cta-topbar.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.cta-topbar-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted, #8b949e);
  min-width: 0;
}
.cta-topbar-actions { display: flex; gap: 6px; flex-shrink: 0; }
.cta-topbar-close {
  flex-shrink: 0;
  background: transparent; border: none;
  color: var(--text-subtle, #6e7681);
  font-size: 18px; line-height: 1;
  cursor: pointer; padding: 0 4px;
  transition: color .15s;
}
.cta-topbar-close:hover { color: var(--text, #e6edf3); }

/* ── Мобильные ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cta-modal { margin: 12px; padding: 22px 18px 18px; }
  .cta-modal-actions { flex-direction: column; }
  .cta-modal-actions .cta-btn { width: 100%; }
  .cta-soft-banner { padding: 12px 40px 12px 12px; }
  .cta-soft-cta { width: 100%; }
  .cta-toast {
    bottom: 12px; right: 12px; left: 12px;
    width: auto;
  }
  .cta-sticky-inner { flex-wrap: wrap; }
  .cta-sticky-text { width: 100%; order: -1; }
  .cta-topbar { flex-wrap: wrap; }
  .cta-topbar-text { width: 100%; }
  .cta-topbar-actions { width: 100%; }
}
