/* ================================================
   PRICING PAGE — PREP Workspace
   ================================================ */

/* ── Variables ── */
:root {
  --primary: #5a189a;
  --primary-light: #9d4edd;
  --accent: #ff6500;
  --accent-hover: #e05500;
  --surface: #ffffff;
  --bg-start: #f7f3ff;
  --bg-mid: #ede5ff;
  --bg-end: #e0d5ff;
  --text-primary: #1a0e2e;
  --text-secondary: #4d4558;
  --text-muted: #7a7087;
  --border: rgba(90, 24, 154, 0.12);
  --border-strong: rgba(90, 24, 154, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-blur: blur(20px) saturate(160%);
  --shadow-sm: 0 2px 8px rgba(90, 24, 154, 0.08);
  --shadow-md: 0 8px 32px rgba(90, 24, 154, 0.12);
  --shadow-lg: 0 20px 60px rgba(90, 24, 154, 0.18);
  --shadow-accent: 0 12px 36px rgba(255, 101, 0, 0.25);
  --radius-md: 18px;
  --radius-lg: 28px;
  --transition: 0.25s ease;
}

/* ── Dark mode variables ── */
body.dark {
  --surface: #0e0a1a;
  --bg-start: #07040f;
  --bg-mid: #0d0820;
  --bg-end: #080512;
  --text-primary: #f0eaff;
  --text-secondary: #c4b8d8;
  --text-muted: #8a7fa0;
  --border: rgba(157, 78, 221, 0.18);
  --border-strong: rgba(157, 78, 221, 0.35);
  --glass-bg: rgba(18, 10, 35, 0.7);
  --glass-border: rgba(157, 78, 221, 0.22);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(90,24,154,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 90%, rgba(255,101,0,0.1) 0%, transparent 50%),
    linear-gradient(160deg, var(--bg-start) 0%, var(--bg-mid) 50%, var(--bg-end) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding: 0 0 64px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── Sticky header ── */
.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  padding: 14px 24px;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(90,24,154,0.08);
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.back-link:hover { background: rgba(255,101,0,0.12); color: var(--accent); }
body.dark .back-link { color: var(--primary-light); background: rgba(157,78,221,0.12); }
body.dark .back-link:hover { color: var(--accent); }

.header-inner h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Billing toggle ── */
.billing-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 0 36px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.toggle-label { cursor: pointer; transition: color var(--transition); }
.toggle-label.active { color: var(--primary); }
body.dark .toggle-label.active { color: var(--primary-light); }

.toggle-switch {
  position: relative;
  width: 54px;
  height: 28px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(90,24,154,0.2);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(26px); }
body.dark .toggle-slider { background: rgba(157,78,221,0.25); }
body.dark .toggle-switch input:checked + .toggle-slider { background: var(--primary-light); }

.save-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Pricing grid ── */
.pricing-grid {
  display: grid;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto 52px;
  padding: 0 24px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}

@media (min-width: 960px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1280px) {
  .pricing-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Plan cards ── */
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 26px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.plan-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255,101,0,0.06), transparent 55%);
  pointer-events: none;
}

.plan-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

/* Studio card */
.plan-card.studio-card { border-color: rgba(90,24,154,0.28); }
.plan-card.studio-card::before {
  background: radial-gradient(circle at top left, rgba(90,24,154,0.1), transparent 55%);
}
body.dark .plan-card.studio-card { border-color: rgba(157,78,221,0.3); }

/* Best value card — slightly elevated */
.plan-card.featured-card {
  border-color: rgba(255,101,0,0.35);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.plan-card.featured-card:hover { transform: translateY(-11px); }
body.dark .plan-card.featured-card { border-color: rgba(255,101,0,0.4); }

/* All children above ::before */
.plan-card > * { position: relative; z-index: 1; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  width: fit-content;
  margin-bottom: 12px;
  background: rgba(90,24,154,0.09);
  color: var(--primary);
}
body.dark .badge { background: rgba(157,78,221,0.14); color: var(--primary-light); }

.studio-badge {
  background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
  color: #fff !important;
}

/* ── Plan label ── */
.plan-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--primary);
  margin-bottom: 10px;
}
body.dark .plan-label { color: var(--primary-light); }

/* ── Price ── */
.price {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 900;
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Override the inline style injected by pricing.js */
.price span,
#proPriceDisplay span,
#studioPriceDisplay span {
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: var(--text-muted) !important;
}

.price-per-month-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: none;
}
.yearly-mode .price-per-month-note { display: block; }

/* ── Plan title ── */
.plan-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 10px 0 8px;
  line-height: 1.2;
}

/* ── Plan description ── */
.plan-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

/* ── Feature list ── */
.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 24px;
  flex: 1;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.plan-features li i {
  color: var(--accent);
  font-size: 0.9rem;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.plan-features li i.fa-times-circle { color: var(--text-muted); opacity: 0.45; }

/* ── CTA ── */
.plan-footer { margin-top: auto; }

.plan-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px rgba(255,101,0,0.2);
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.plan-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}
.plan-cta:active { transform: translateY(0); }
.plan-cta:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.plan-card.studio-card .plan-cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  box-shadow: 0 4px 14px rgba(90,24,154,0.25);
}
.plan-card.studio-card .plan-cta:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, #c041e0 100%);
  box-shadow: 0 12px 36px rgba(90,24,154,0.35);
}

/* ── Comparison section ── */
.comparison-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.comparison-inner {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.comparison-section h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}
body.dark .comparison-section h2 { color: var(--primary-light); }

.comparison-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.comparison-table thead tr {
  background: linear-gradient(135deg, rgba(90,24,154,0.05), rgba(90,24,154,0.02));
}
body.dark .comparison-table thead tr { background: rgba(157,78,221,0.09); }

.comparison-table th {
  padding: 13px 18px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: left;
  border-bottom: 2px solid var(--border-strong);
}
body.dark .comparison-table th { color: var(--primary-light); border-color: rgba(157,78,221,0.3); }

.comparison-table td {
  padding: 12px 18px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.comparison-table td:first-child { font-weight: 600; color: var(--text-primary); }

.comparison-table tbody tr:nth-child(odd) { background: rgba(90,24,154,0.02); }
body.dark .comparison-table tbody tr:nth-child(odd) { background: rgba(157,78,221,0.04); }

.comparison-table tbody tr:hover { background: rgba(90,24,154,0.055); }
body.dark .comparison-table tbody tr:hover { background: rgba(157,78,221,0.08); }

.comparison-table .highlight { color: var(--accent); font-weight: 700; }

/* ── Footer ── */
.pricing-footer {
  max-width: 760px;
  margin: 36px auto 0;
  padding: 0 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.8;
}
.pricing-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
.pricing-footer a:hover { color: var(--accent); }
body.dark .pricing-footer a { color: var(--primary-light); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .pricing-grid { padding: 0 16px; gap: 16px; }
  .comparison-section { padding: 0 16px; }
  .plan-card.featured-card { transform: none; }
  .plan-card.featured-card:hover { transform: translateY(-4px); }
  .billing-toggle-wrap { padding: 24px 0 28px; }
}

@media (max-width: 480px) {
  .page-header { padding: 12px 16px; }
  .plan-card { padding: 22px 18px; }
}

/* ── Accessibility ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
