/* ============================================================
   prices.css — Public prices page (free plan, billing toggle, cards)
   Matches project design system (main.css, home.css)
   ============================================================ */

/* ── Paddle info banner (bottom of pricing page, before cta-block) ─ */
.prices-paddle-banner {
  margin-top: 24px;
  margin-bottom: 0;
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--muted);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  text-align: center;
}
[data-theme="dark"] .prices-paddle-banner {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.25);
}
.prices-paddle-banner a {
  color: inherit;
  text-decoration: underline;
}
.prices-btn-disabled {
  cursor: not-allowed;
  opacity: 0.7;
}
.prices-btn-disabled:hover {
  cursor: not-allowed;
}

/* ── Billing toggle ───────────────────────────────────────── */
.prices-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.prices-toggle {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  box-shadow: var(--shadow);
}
[data-theme="dark"] .prices-toggle {
  background: var(--white);
  border-color: var(--border);
}
.prices-toggle-btn {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.prices-toggle-btn:hover {
  color: var(--text);
}
.prices-toggle-btn.active {
  background: var(--primary);
  color: #fff;
}
.prices-toggle-btn.active:hover {
  color: #fff;
  background: var(--accent);
}
.prices-save-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--success);
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: var(--radius-sm);
}
[data-theme="dark"] .prices-save-badge {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.35);
}
.prices-save-badge--monthly {
  border: 1px solid rgb(163 22 22 / 30%);
  color: #ff0000;
  background: rgb(163 22 22 / 30%);
  text-decoration: line-through;
}
[data-theme="dark"] .prices-save-badge--monthly {
  border-color: rgb(163 22 22 / 40%);
  background: rgb(163 22 22 / 25%);
}

/* ── Prices page wrapper (centered) ────────────────────────── */
.prices-page-content {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Pricing cards grid ──────────────────────────────────── */
.prices-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}
@media (min-width: 640px) {
  .prices-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .prices-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Three-tier layout (Free / Basic / Premium) */
.prices-grid--three {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
@media (min-width: 900px) {
  .prices-grid--three { grid-template-columns: repeat(3, 1fr); }
}

/* ── Pricing card ─────────────────────────────────────────── */
.prices-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s;
  height: 100%;
}
[data-theme="dark"] .prices-card {
  background: var(--white);
  border-color: var(--border);
}
.prices-card:hover {
  box-shadow: var(--shadow-md);
}

/* Row 1: icon + plan name (compact, no desc) */
.prices-card-header {
  margin-bottom: 16px;
}

/* Row 2: price + buy button */
.prices-card-action {
  margin-bottom: 20px;
}

/* Row 3: description + hub selector + features (grows to fill remaining space) */
.prices-card-body {
  flex: 1;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.prices-card.prices-card--popular {
  position: relative;
  border-color: var(--primary);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 12%, transparent);
}
[data-theme="dark"] .prices-card.prices-card--popular {
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.18);
}
.prices-card-badge {
  position: absolute;
  top: 5px;
  right: -25px;
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border-radius: 15px;
  text-align: center;
  transform: rotate(30deg);
}
.prices-card.prices-card--popular {
  /* padding-top: 52px; */
}
.prices-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}
.prices-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.prices-card-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
}
.prices-card-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.prices-card-price-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.prices-card-features {
  list-style: none;
  padding: 0;
  margin: 0;
}
.prices-card-features li {
  font-size: 0.875rem;
  color: var(--subtle);
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  line-height: 1.4;
}
.prices-card-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}
.prices-card-cta {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.2s, color 0.2s;
}
.prices-card-cta.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.prices-card-cta.btn-outline:hover {
  background: var(--primary-soft);
  color: var(--accent);
}
.prices-card-cta.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
}
.prices-card-cta.btn-primary:hover {
  background: var(--accent);
  color: #fff;
}
.prices-card-cta.btn-primary.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.prices-promo-hint {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 28px;
}

/* ── Selectable component (One Component plan) ─────────────── */
.prices-component-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 8px;
}
.prices-component-option:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 4%, transparent);
}
.prices-component-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
[data-theme="dark"] .prices-component-option.selected {
  background: rgba(59, 130, 246, 0.12);
}
.prices-component-option input {
  margin: 0;
  accent-color: var(--primary);
}
.prices-component-option-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Invite discount banner & badge ───────────────────────────── */
.prices-invite-banner {
  padding: 12px 16px;
  margin-bottom: 20px;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: var(--radius-sm);
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}
[data-theme="dark"] .prices-invite-banner {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.35);
}
.prices-invite-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(22, 163, 74, 0.12);
  border-radius: var(--radius-sm);
}
[data-theme="dark"] .prices-invite-badge {
  background: rgba(34, 197, 94, 0.15);
}

/* ── Hub group selector (Basic plan) ──────────────────────── */
.prices-hub-selector {
  margin-bottom: 16px;
}
.prices-hub-selector-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.prices-hub-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prices-hub-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}
.prices-hub-option:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 4%, transparent);
}
.prices-hub-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
[data-theme="dark"] .prices-hub-option.selected {
  background: rgba(59, 130, 246, 0.12);
}
.prices-hub-option input[type="radio"] {
  margin: 0;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.prices-hub-option-emoji {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.prices-hub-option-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* Paddle checkout root per-plan wrapper */
.pricing-paddle-react-wrap {
  margin-top: 8px;
}
.pricing-hub-required {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(99, 102, 241, 0.07);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: 8px;
}

/* ── Basic hub confirmation modal ─────────────────────────── */

/* Scroll-lock when modal is open */
body.prices-modal-open {
  overflow: hidden;
}

/* Full-viewport overlay */
.prices-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: prices-modal-fade-in 0.18s ease;
}
.prices-modal-overlay[hidden] {
  display: none;
}
@keyframes prices-modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Dialog box */
.prices-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--white, #fff);
  border-radius: var(--radius, 12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  padding: 32px 28px 28px;
  animation: prices-modal-slide-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="dark"] .prices-modal {
  background: #1e1e2e;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
@keyframes prices-modal-slide-in {
  from { transform: translateY(12px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Close button */
.prices-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 1.25rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.prices-modal-close:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--text);
}
[data-theme="dark"] .prices-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Modal text */
.prices-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  padding-right: 24px; /* don't overlap close button */
}
.prices-modal-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 20px;
}

/* Hub options inside modal — slightly larger touch targets */
.prices-modal-hub-options {
  gap: 10px;
  margin-bottom: 24px;
}
.prices-modal-hub-options .prices-hub-option {
  padding: 12px 16px;
}

/* Divider above the Paddle CTA */
.prices-modal-paddle-wrap {
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: 18px;
  margin-top: 0;
}
[data-theme="dark"] .prices-modal-paddle-wrap {
  border-color: rgba(255, 255, 255, 0.1);
}
