/* ═══════════════════════════════════════════════════════════════════════
   pro-modal.css — Focus Pro popup + feature locks

   The popup follows the same glass card, tokens and light/dark rules as the
   sign-in gate, so it looks native on every theme.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── buttons — scoped to the popup card so the app's own .btn rules are
   never touched ── */
#pro-modal .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.05s, background 0.15s, border-color 0.15s;
}
#pro-modal .btn:active { transform: translateY(1px); }
#pro-modal .btn:disabled { opacity: 0.6; cursor: default; transform: none; }
#pro-modal .btn-sm { padding: 0.5rem 0.9rem; font-size: 0.85rem; }
#pro-modal .btn-primary { background: var(--focus-tint); color: #fff; }
#pro-modal .btn-secondary {
  background: color-mix(in srgb, var(--surface-1) 78%, transparent);
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--text-muted) 34%, transparent);
}

/* ── the popup ────────────────────────────────────────────────────────── */

#pro-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  overflow-y: auto;
  overscroll-behavior: contain;
}

#pro-modal::backdrop {
  background:
    radial-gradient(58% 48% at 18% 8%, color-mix(in srgb, var(--focus-tint) 26%, transparent), transparent 72%),
    radial-gradient(52% 56% at 86% 92%, color-mix(in srgb, #7c5cbf 22%, transparent), transparent 74%),
    radial-gradient(40% 40% at 78% 18%, color-mix(in srgb, #2aa198 12%, transparent), transparent 70%),
    rgba(7, 7, 11, 0.72);
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
}

:root[data-theme="light"] #pro-modal::backdrop {
  background:
    radial-gradient(58% 48% at 18% 8%, color-mix(in srgb, var(--focus-tint) 18%, transparent), transparent 72%),
    radial-gradient(52% 56% at 86% 92%, color-mix(in srgb, #7c5cbf 14%, transparent), transparent 74%),
    rgba(243, 242, 239, 0.72);
}

.pro-shell {
  min-height: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vh, 40px) 16px;
  padding-top: max(clamp(16px, 4vh, 40px), env(safe-area-inset-top));
  padding-bottom: max(clamp(16px, 4vh, 40px), env(safe-area-inset-bottom));
}

.pro-card {
  position: relative;
  width: min(620px, 100%);
  max-height: min(88vh, 900px);
  overflow-y: auto;
  padding: clamp(22px, 4vw, 34px);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    0 50px 130px -40px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(34px) saturate(155%);
  -webkit-backdrop-filter: blur(34px) saturate(155%);
}

:root[data-theme="light"] .pro-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.76));
  border-color: rgba(11, 11, 11, 0.1);
  box-shadow:
    0 40px 110px -40px rgba(30, 25, 20, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.pro-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.pro-close:hover { background: rgba(255, 255, 255, 0.12); color: var(--text-primary); }
:root[data-theme="light"] .pro-close { background: rgba(255, 255, 255, 0.7); border-color: rgba(11, 11, 11, 0.12); }
.pro-close svg { width: 16px; height: 16px; }

.pro-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--focus-text);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.pro-brand svg { width: 26px; height: 26px; display: block; }
.pro-brand span { color: var(--text-primary); }

.pro-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--focus-text);
}
.pro-title {
  margin: 0;
  font-size: clamp(24px, 4.4vw, 30px);
  line-height: 1.12;
  font-weight: 760;
  letter-spacing: -0.035em;
}
.pro-lead {
  margin: 8px 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.pro-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 18px;
}
@media (max-width: 560px) { .pro-features { grid-template-columns: 1fr; } }

.pro-feature {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
:root[data-theme="light"] .pro-feature { border-color: rgba(11, 11, 11, 0.07); }
.pro-feature-ic {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--focus-tint) 16%, transparent);
  color: var(--focus-text);
}
.pro-feature-ic svg { width: 17px; height: 17px; display: block; }
.pro-feature strong { display: block; font-size: 13px; line-height: 1.25; }
.pro-feature-copy { display: block; min-width: 0; }
.pro-feature-copy > span { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: var(--text-muted); }

.pro-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
@media (max-width: 520px) { .pro-plans { grid-template-columns: 1fr; } }

.pro-plan {
  position: relative;
  padding: 16px;
  border-radius: 18px;
  border: 1.5px solid color-mix(in srgb, var(--text-muted) 26%, transparent);
  background: color-mix(in srgb, var(--surface-1) 55%, transparent);
  text-align: left;
}
.pro-plan.is-best { border-color: var(--focus-tint); }
.pro-flag {
  position: absolute;
  top: -9px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--focus-tint);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pro-plan-name { margin: 0; font-size: 14px; font-weight: 700; }
.pro-price { margin: 3px 0 1px; font-size: 27px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.pro-price small { font-size: 12px; font-weight: 550; color: var(--text-muted); letter-spacing: 0; }
.pro-plan-note { margin: 0 0 10px; font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.pro-plan .btn { width: 100%; justify-content: center; }
.pro-save { margin: 0 0 2px; font-size: 11.5px; font-weight: 700; color: var(--break-text); }

.pro-active {
  padding: 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--break-tint) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--break-tint) 40%, transparent);
}
.pro-active h3 { margin: 0 0 4px; font-size: 16px; }
.pro-active p { margin: 2px 0; font-size: 13px; color: var(--text-secondary); }
.pro-active .btn { margin-top: 10px; }
.pro-canceled {
  margin: 0 0 12px;
  background: color-mix(in srgb, var(--focus-tint) 9%, transparent);
  border-color: color-mix(in srgb, var(--focus-tint) 34%, transparent);
}

.pro-msg {
  min-height: 18px;
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
  text-align: center;
}
.pro-msg[data-kind="error"] { color: #ff9d8d; }
:root[data-theme="light"] .pro-msg[data-kind="error"] { color: #b02a1c; }
.pro-msg a { color: var(--focus-text); text-underline-offset: 2px; }

.pro-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 11.5px;
  color: var(--text-muted);
}
:root[data-theme="light"] .pro-foot { border-top-color: rgba(11, 11, 11, 0.08); }
.pro-foot a { color: inherit; text-underline-offset: 2px; }

.pro-loading {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 26px 0 18px;
  color: var(--text-secondary);
  font-size: 13px;
}
.pro-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--focus-tint) 24%, transparent);
  border-top-color: var(--focus-tint);
  animation: pro-spin 0.85s linear infinite;
}
@keyframes pro-spin { to { transform: rotate(360deg); } }

/* ── shared feature locks ─────────────────────────────────────────────── */

.pf-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--page) 62%, transparent);
  backdrop-filter: blur(7px) saturate(115%);
  -webkit-backdrop-filter: blur(7px) saturate(115%);
  text-align: center;
}
.pf-lock-overlay--view { position: absolute; }

.pf-lock-inner {
  display: grid;
  justify-items: center;
  gap: 7px;
  max-width: 320px;
}
.pf-lock-ic {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--focus-tint) 16%, transparent);
  color: var(--focus-text);
}
.pf-lock-ic svg { width: 20px; height: 20px; }
.pf-lock-title { font-size: 14.5px; font-weight: 720; letter-spacing: -0.01em; }
.pf-lock-desc { font-size: 12px; line-height: 1.45; color: var(--text-secondary); }
.pf-lock-overlay .pf-lock-btn { margin-top: 4px; }

.pf-locked { position: relative; }
.pf-view-locked { position: relative; }
.pf-view-locked > *:not(.pf-lock-overlay) {
  filter: blur(6px);
  opacity: 0.38;
  pointer-events: none;
  user-select: none;
}

.theme-tile.is-locked { opacity: 0.62; }
.theme-tile.is-locked .tt-art { filter: grayscale(0.55); }
.theme-tile .tt-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--page) 65%, transparent);
  color: var(--text-primary);
}
.theme-tile .tt-lock svg { width: 12px; height: 12px; }

@media (prefers-reduced-motion: reduce) {
  .pro-spinner { animation-duration: 2.4s; }
}
