/* ── Plan gates, upgrade prompts, lock states, limit banners ── */

/* ── Upgrade overlay modal ──────────────────────────────────────────── */
.ct-upgrade-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: ct-fadeIn 0.2s ease-out;
  padding: 20px;
}

.ct-upgrade-card {
  background: var(--ct-surface, #fff);
  border-radius: var(--ct-radius-card, 20px);
  box-shadow: var(--ct-shadow-lg);
  padding: 36px 32px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  animation: ct-scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ct-upgrade-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--ct-radius-pill, 999px);
  background: var(--brand-100, rgba(59, 130, 246, 0.08));
  color: var(--brand-600, #3B82F6);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.ct-upgrade-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ct-text, #0b1220);
  margin: 0 0 8px;
}

.ct-upgrade-message {
  font-size: 14px;
  color: var(--ct-text-muted, #6b7280);
  line-height: 1.55;
  margin: 0 0 22px;
}

.ct-upgrade-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ct-upgrade-cta {
  width: 100%;
}

.ct-upgrade-dismiss {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--ct-text-muted, #6b7280);
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
}

.ct-upgrade-dismiss:hover {
  color: var(--ct-text, #0b1220);
}

/* ── Rich upgrade card (with feature list) ─────────────────────────── */
.ct-upgrade-card-rich {
  max-width: 440px;
  text-align: left;
}

.ct-upgrade-card-rich .ct-upgrade-badge {
  margin-bottom: 12px;
}

.ct-upgrade-card-rich .ct-upgrade-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ct-upgrade-card-rich .ct-upgrade-message {
  margin-bottom: 16px;
}

.ct-upgrade-features {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ct-upgrade-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ct-text, #111827);
  line-height: 1.4;
}

.ct-upgrade-features li::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  background: var(--brand-100, rgba(59, 130, 246, 0.08));
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px;
}

@keyframes ct-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes ct-scaleIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Lock badge (on gated elements) ─────────────────────────────────── */
.ct-plan-locked {
  position: relative;
  opacity: 0.6;
  pointer-events: auto;
  cursor: pointer;
}

.ct-plan-locked::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.02);
  pointer-events: none;
}

.ct-lock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 10px;
  border-radius: var(--ct-radius-pill, 999px);
  background: var(--brand-600, #3B82F6);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.6;
  z-index: 2;
  pointer-events: none;
}

/* ── Limit banner ───────────────────────────────────────────────────── */
.ct-limit-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--ct-radius-control, 12px);
  background: var(--ct-surface-muted, #f3f4f6);
  border: 1px solid var(--ct-border, #e5e7eb);
  font-size: 13px;
  color: var(--ct-text-muted, #6b7280);
  margin-bottom: 12px;
}

.ct-limit-banner.ct-limit-reached {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.ct-limit-link {
  color: var(--brand-600, #3B82F6);
  font-weight: 600;
  text-decoration: none;
}

.ct-limit-link:hover {
  text-decoration: underline;
}

/* ── Trial pill (compact, inline next to Customize button) ──────────── */
.dashboard-greeting-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ct-trial-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.ct-trial-pill strong {
  font-weight: 700;
}

.ct-trial-pill:hover {
  background: #DBEAFE;
}

/* ── Inline upgrade nudge (for within sections) ─────────────────────── */
.ct-upgrade-nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--ct-radius-control, 12px);
  background: var(--brand-050, rgba(59, 130, 246, 0.04));
  border: 1px dashed var(--brand-400, #3B82F6);
  font-size: 13px;
  color: var(--ct-text-muted, #6b7280);
  margin: 12px 0;
}

.ct-upgrade-nudge a {
  color: var(--brand-600, #3B82F6);
  font-weight: 600;
  text-decoration: none;
}

.ct-upgrade-nudge a:hover {
  text-decoration: underline;
}

/* ── Dark mode overrides ────────────────────────────────────────────── */
.dark-mode .ct-upgrade-card {
  background: var(--surface);
  border-color: var(--border);
}

.dark-mode .ct-limit-banner.ct-limit-reached {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
}

.dark-mode .ct-plan-locked::after {
  background: rgba(255, 255, 255, 0.02);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .ct-upgrade-card {
    padding: 28px 22px 22px;
  }
  .dashboard-greeting-actions {
    flex-wrap: wrap;
  }
  .ct-trial-pill {
    font-size: 11px;
    padding: 4px 10px;
  }
}
