/* ─────────────────────────────────────────────────────────────────
   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. 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); }

/* ── 7. CONTEXTUAL SIGNUP NUDGE ───────────────────────────────── */
.tool-cta-host {
  margin: 10px 0 12px;
}
.article .cta-signup-nudge {
  margin: 20px 0;
}
.cta-signup-nudge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  background: var(--bg-2, #161b22);
  color: var(--text, #e6edf3);
  box-shadow: var(--shadow-sm, 0 2px 10px rgba(0,0,0,.18));
}
.cta-signup-nudge-compact {
  flex-direction: column;
  align-items: stretch;
  padding: 12px;
}
.cta-signup-nudge-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #58a6ff);
  background: rgba(88, 166, 255, .1);
  border: 1px solid rgba(88, 166, 255, .22);
  flex-shrink: 0;
}
.cta-signup-nudge-icon svg {
  width: 18px;
  height: 18px;
}
.cta-signup-nudge-copy {
  flex: 1;
  min-width: 0;
}
.cta-signup-nudge-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #e6edf3);
  line-height: 1.35;
}
.cta-signup-nudge-desc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted, #8b949e);
  line-height: 1.45;
}
.cta-signup-nudge-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Мобильные ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cta-btn,
  .cta-btn-sm,
  .cta-btn-primary,
  .cta-btn-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .cta-modal-close,
  .cta-soft-close,
  .cta-topbar-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .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-topbar { flex-wrap: wrap; }
  .cta-topbar-text { width: 100%; }
  .cta-topbar-actions { width: 100%; }
  .cta-topbar-actions .cta-btn { flex: 1 1 0; }
  .cta-signup-nudge {
    align-items: stretch;
    flex-direction: column;
  }
  .cta-signup-nudge-actions {
    width: 100%;
  }
  .cta-signup-nudge-actions .cta-btn {
    flex: 1 1 0;
  }
  .cta-plus-nudge { flex-wrap: wrap; }
  .cta-plus-nudge-copy { flex: 1 1 100%; }
  .cta-plus-nudge-cta { flex: 1 1 auto; text-align: center; }
}

/* ── Plus-нудж (контекстный, для залогиненных free-юзеров) ───────── */
.cta-plus-nudge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--success-border, rgba(63, 185, 80, .35));
  border-radius: 8px;
  background: var(--success-bg, rgba(63, 185, 80, .08));
  color: var(--text);
}
.cta-plus-nudge-ico {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  color: #f0b429;
}
.cta-plus-nudge-ico svg { width: 22px; height: 22px; }
.cta-plus-nudge-copy { flex: 1; min-width: 0; }
.cta-plus-nudge-title { font-weight: 600; font-size: .9em; color: var(--text); }
.cta-plus-nudge-desc { font-size: .82em; color: var(--text-muted); margin-top: 1px; }
.cta-plus-nudge-cta { flex-shrink: 0; text-decoration: none; display: inline-flex; align-items: center; }
.cta-plus-nudge-close {
  flex-shrink: 0;
  background: transparent; border: none;
  color: var(--text-muted);
  font-size: 18px; line-height: 1;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
  transition: color .15s, background .15s;
}
.cta-plus-nudge-close:hover { color: var(--text); background: var(--bg-3); }
