/* ============================================================
   STREET TASKERS — subscription.css
   Sprint 2: Subscription tiers, slot meter, comparison table
   Depends on: styles.css (must be loaded first)
   ============================================================ */

/* ── Page layout ─────────────────────────────────────────────── */
.subscription-page {
  min-height: 100vh;
  padding-top: var(--nav-height);
  background: var(--bg);
}

/* ── Hero ─────────────────────────────────────────────────────── */
.sub-hero {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding: 56px 0 48px;
  text-align: center;
}
.sub-hero h1 { margin-bottom: 12px; }
.sub-hero p  { font-size: 1.05rem; max-width: 520px; margin: 0 auto 28px; }

/* ── Free slot meter ─────────────────────────────────────────── */
.slot-meter-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.slot-meter-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.slot-pips {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.slot-pip {
  flex: 1;
  height: 8px;
  border-radius: var(--radius-pill);
  transition: background var(--t) var(--ease);
}
.slot-used  { background: var(--blue); }
.slot-empty { background: var(--border); }

.slot-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.slot-label-full { color: var(--red); font-weight: 600; }

/* ── Upgrade notice ──────────────────────────────────────────── */
.upgrade-notice {
  display: none;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--amber-light);
  border: 1px solid rgba(217,119,6,0.25);
  border-radius: var(--radius-md);
  margin-top: 14px;
  font-size: 0.84rem;
  color: #92400E;
  line-height: 1.5;
}
.upgrade-notice svg { stroke: var(--amber); flex-shrink: 0; margin-top: 1px; }

.upgrade-notice.notice-urgent {
  background: var(--red-light);
  border-color: rgba(220,38,38,0.2);
  color: var(--red);
}
.upgrade-notice.notice-urgent svg { stroke: var(--red); }

/* ── Billing toggle ──────────────────────────────────────────── */
.billing-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 40px;
}
.billing-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--t) var(--ease);
}
.billing-label.billing-active { color: var(--text-primary); font-weight: 600; }

.billing-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
}
.billing-toggle-switch input { opacity:0; width:0; height:0; position:absolute; }
.billing-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--t) var(--ease);
}
.billing-toggle-track::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--t) var(--ease);
  box-shadow: var(--shadow-xs);
}
.billing-toggle-switch input:checked + .billing-toggle-track { background: var(--blue); }
.billing-toggle-switch input:checked + .billing-toggle-track::before { transform: translateX(20px); }

.annual-savings-badge {
  display: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(22,163,74,0.2);
  border-radius: var(--radius-pill);
}

/* ── Plan cards grid ─────────────────────────────────────────── */
.plan-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 64px;
}

.plan-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  position: relative;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}

.plan-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.plan-highlighted {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(10,132,255,0.15), var(--shadow-lg);
  transform: translateY(-4px);
}
.plan-highlighted:hover { transform: translateY(-6px); }

/* ── Plan badge ──────────────────────────────────────────────── */
.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ── Plan header ─────────────────────────────────────────────── */
.plan-header { margin-bottom: 24px; }
.plan-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.plan-price { display: flex; align-items: baseline; gap: 3px; margin-bottom: 8px; }
.plan-price-amount {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
}
.plan-price-period { font-size: 0.875rem; color: var(--text-muted); font-weight: 400; }
.plan-desc { font-size: 0.84rem; color: var(--text-secondary); line-height: 1.5; }

/* ── Plan features ───────────────────────────────────────────── */
.plan-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.plan-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
}
.feature-yes { color: var(--text-primary); }
.feature-no  { color: var(--text-muted); }
.feature-no  span { text-decoration: line-through; }

/* ── Plan CTA ────────────────────────────────────────────────── */
.plan-cta { margin-bottom: 10px; }
.plan-current-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Comparison table ────────────────────────────────────────── */
.comparison-section { padding: 0 0 88px; }
.comparison-section-header { text-align: center; margin-bottom: 32px; }
.comparison-section-header h2 { font-size: 1.5rem; margin-bottom: 8px; }

.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.comparison-table th {
  padding: 16px 20px;
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--text-secondary);
}
.comparison-table th:first-child {
  text-align: left;
  color: var(--text-primary);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.comp-highlight-head {
  background: var(--blue-light) !important;
  color: var(--blue) !important;
  border-top: 2px solid var(--blue);
}
.comparison-table td {
  padding: 12px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: middle;
}
.comparison-table td:first-child, .comparison-table th:first-child {
  width: 220px;
  border-right: 1px solid var(--border-strong);
}
.comparison-table tr:last-child td { border-bottom: none; }
.comp-feature { text-align: left; font-size: 0.84rem; color: var(--text-secondary); }
.comp-yes svg { margin: 0 auto; display: block; }
.comp-no  svg { margin: 0 auto; display: block; }

/* ── Subscription modal ──────────────────────────────────────── */
.subscription-modal-box { max-width: 440px; text-align: left; }
.sub-modal-plan-preview {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}
.sub-modal-plan-name  { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.sub-modal-plan-price { font-size: 0.875rem; color: var(--text-muted); }
.sub-modal-plan-limit { font-size: 0.82rem; color: var(--blue); font-weight: 500; margin-top: 6px; }
.sub-modal-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.5;
}
.sub-modal-disclaimer a { color: var(--blue); }

/* ── FAQ accordion ───────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 0; }
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }
.faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
}
.faq-arrow {
  flex-shrink: 0;
  transition: transform var(--t) var(--ease);
}
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-body {
  display: none;
  padding: 0 0 18px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.faq-item.open .faq-body { display: block; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .plan-cards-grid { grid-template-columns: 1fr; gap: 14px; }
  .plan-highlighted { transform: none; }
  .plan-highlighted:hover { transform: translateY(-2px); }
  .plan-badge { position: static; transform: none; display: inline-flex; margin-bottom: 12px; }
}

@media (max-width: 600px) {
  .comparison-table th, .comparison-table td { padding: 10px 12px; font-size: 0.8rem; }
  .comp-feature { min-width: 140px; }
}

/* ── Shared modal styles (local copy for pages without tasks.css) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.modal-open { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 48px rgba(0,0,0,0.12);
  position: relative;
  animation: modalIn 0.28s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close-x {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 6px;
  background: none; border: none;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.modal-close-x:hover { background: var(--gray-100); }
.modal-close-x svg { stroke: var(--text-muted); }
.sprint-modal-box { border-top: 3px solid var(--amber); }
.sprint-modal-icon {
  width: 52px; height: 52px;
  background: var(--amber-light);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.sprint-modal-icon svg { stroke: var(--amber); }
[data-sprint-message] { white-space: pre-line; font-size: 0.875rem; color: var(--text-secondary); }
.btn-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
