/* ================================================================
   SichAdAnalize — CTA-система (компоненты)
   Подключается ПОСЛЕ tokens.css и plus.css.

   6 типов CTA из ТЗ §12.3. Каждый помечен правилами применения.
   Модификаторы продукта:  .is-plus (янтарь) | .is-bm (фиолет) | .is-reg (синий)
   ================================================================ */

/* общий акцент компонента через локальную переменную --c / --c-bg / --c-border */
.cta-inline, .cta-nudge, .cta-paywall, .cta-empty, .cta-modal-card, .cta-topbar {
  --c: var(--accent); --c-bg: var(--accent-bg); --c-border: var(--border-focus);
  --c-fg: #06121f;
}
.is-plus { --c: var(--plus); --c-bg: var(--plus-bg); --c-border: var(--plus-border); --c-fg: #1a1205; }
.is-bm   { --c: var(--bm);   --c-bg: var(--bm-bg);   --c-border: var(--bm-border);   --c-fg: #fff; }
.is-reg  { --c: var(--accent); --c-bg: var(--accent-bg); --c-border: var(--border-focus); --c-fg: #06121f; }

.cta-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 700; line-height: 1;
  padding: 9px 15px; border-radius: var(--radius-md); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: all var(--transition);
}
.cta-act-primary { background: var(--c); color: var(--c-fg); }
.cta-act-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cta-act-ghost { background: transparent; color: var(--c); border-color: var(--c-border); }
.cta-act-ghost:hover { background: var(--c-bg); }
.cta-act-link { background: transparent; color: var(--text-muted); padding: 9px 4px; }
.cta-act-link:hover { color: var(--text); }
.cta-x {
  background: transparent; border: none; color: var(--text-subtle); cursor: pointer;
  width: 26px; height: 26px; border-radius: var(--radius-sm); display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0; font-size: 17px; line-height: 1;
}
.cta-x:hover { background: var(--bg-3); color: var(--text); }

/* ── 1. INLINE CTA AFTER VALUE ─────────────────────────────────
   ПОСЛЕ таблицы/расчёта/результата. Не перекрывает данные. */
.cta-inline {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-2); border: 1px solid var(--border); border-left: 3px solid var(--c);
  border-radius: var(--radius-md); padding: 14px 16px;
}
.cta-inline .cta-ic {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--radius-md);
  background: var(--c-bg); color: var(--c); display: flex; align-items: center; justify-content: center;
}
.cta-inline .cta-body { flex: 1; min-width: 0; }
.cta-inline .cta-title { font-size: 14px; font-weight: 700; color: var(--text); }
.cta-inline .cta-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.cta-inline .cta-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
@media (max-width: 640px) {
  .cta-inline { flex-direction: column; align-items: stretch; }
  .cta-inline .cta-actions { flex-direction: column; }
  .cta-inline .cta-act { width: 100%; }
}

/* ── 2. COMPACT NUDGE ──────────────────────────────────────────
   Маленький блок рядом с disabled-контролом (напр. правка цены). */
.cta-nudge {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius-md);
  padding: 7px 11px; font-size: 12.5px; color: var(--text);
}
.cta-nudge svg { color: var(--c); flex-shrink: 0; }
.cta-nudge .cta-nudge-link { color: var(--c); font-weight: 700; text-decoration: none; white-space: nowrap; }
.cta-nudge .cta-nudge-link:hover { text-decoration: underline; }

/* ── 3. PAYWALL BANNER ─────────────────────────────────────────
   Верхний баннер на закрытой странице с preview. */
.cta-paywall {
  position: relative; overflow: hidden;
  background:
    linear-gradient(180deg, var(--c-bg), transparent 80%), var(--bg-2);
  border: 1px solid var(--c-border); border-radius: var(--radius-md);
  padding: 18px 20px; display: flex; align-items: center; gap: 18px;
}
.cta-paywall .cta-ic {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-md);
  background: var(--c-bg); border: 1px solid var(--c-border); color: var(--c);
  display: flex; align-items: center; justify-content: center;
}
.cta-paywall .cta-body { flex: 1; min-width: 0; }
.cta-paywall .cta-kicker {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--c);
}
.cta-paywall .cta-title { font-size: 17px; font-weight: 800; color: var(--text); margin-top: 3px; letter-spacing: -.01em; }
.cta-paywall .cta-desc { font-size: 13px; color: var(--text-muted); margin-top: 5px; line-height: 1.6; max-width: 62ch; }
.cta-paywall .cta-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
@media (max-width: 800px) {
  .cta-paywall { flex-direction: column; align-items: flex-start; }
  .cta-paywall .cta-actions { width: 100%; flex-wrap: wrap; }
  .cta-paywall .cta-act { flex: 1; }
}

/* ── 4. EMPTY STATE CTA ────────────────────────────────────────
   Когда данных нет, но есть полезное действие. */
.cta-empty {
  border: 1px dashed var(--border); border-radius: var(--radius-md); background: var(--bg-2);
  padding: 30px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.cta-empty .cta-ic {
  width: 46px; height: 46px; border-radius: var(--radius-md); background: var(--bg-3);
  border: 1px solid var(--border); color: var(--c); display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.cta-empty .cta-title { font-size: 15px; font-weight: 700; color: var(--text); }
.cta-empty .cta-desc { font-size: 13px; color: var(--text-muted); max-width: 46ch; line-height: 1.6; }
.cta-empty .cta-actions { display: flex; gap: 9px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }

/* ── 5. MODAL CTA ──────────────────────────────────────────────
   Только после явного действия (клик по закрытому контролу). */
.cta-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.cta-modal-overlay.open { display: flex; }
.cta-modal-card {
  width: min(440px, 100%); background: var(--bg-overlay); border: 1px solid var(--border);
  border-top: 3px solid var(--c); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.cta-modal-head { padding: 20px 20px 0; display: flex; align-items: flex-start; gap: 12px; }
.cta-modal-card .cta-ic {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-md);
  background: var(--c-bg); color: var(--c); display: flex; align-items: center; justify-content: center;
}
.cta-modal-card .cta-title { font-size: 17px; font-weight: 800; color: var(--text); }
.cta-modal-card .cta-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; padding: 8px 20px 0; }
.cta-modal-feat { padding: 14px 20px 4px; display: flex; flex-direction: column; gap: 8px; }
.cta-modal-feat .f { display: flex; gap: 9px; font-size: 13px; color: var(--text); align-items: flex-start; }
.cta-modal-feat .f svg { color: var(--c); flex-shrink: 0; margin-top: 1px; }
.cta-modal-foot { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 8px; }

/* ── 6. TOPBAR CTA ─────────────────────────────────────────────
   Глобальный анонс. Очень редкий, компактный, dismissible. */
.cta-topbar {
  background: var(--c-bg); border-bottom: 1px solid var(--c-border);
  padding: 8px 20px; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 13px;
}
.cta-topbar .cta-topbar-msg { color: var(--text); }
.cta-topbar .cta-topbar-msg strong { color: var(--c); }
.cta-topbar .cta-topbar-link {
  color: var(--c); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.cta-topbar .cta-topbar-link:hover { text-decoration: underline; }
.cta-topbar .cta-x { margin-left: 6px; }
@media (max-width: 560px) { .cta-topbar { font-size: 12px; gap: 8px; } }

/* ── Состояние «уже куплено» / доступ есть ────────────────────
   CTA не должен продавать то, что уже доступно. */
.cta-owned {
  display: flex; align-items: center; gap: 11px; padding: 12px 15px;
  background: var(--success-bg); border: 1px solid var(--success-border); border-radius: var(--radius-md);
  font-size: 13px; color: var(--text);
}
.cta-owned svg { color: var(--success); flex-shrink: 0; }
.cta-owned .cta-owned-strong { font-weight: 700; }
.cta-owned .cta-owned-meta { margin-left: auto; color: var(--text-muted); font-size: 12px; }
