/* Pricing Page Styles
   - Mobile-first, responsive, and accessible
   - Mirrors the project's tokens/components
   - TODO: adjust brand tokens if needed to match global theme
*/

/* Root theme variables */
:root {
  --color-purple: #6A1B9A;
  --color-yellow: #FFD54F;

  --color-text: #1a1a1a;
  --color-text-on-purple: #ffffff;
  --color-text-on-yellow: #6A1B9A;

  --color-bg: #ffffff;
  --color-surface: #f7f4fa;
  --color-surface-strong: #efe8f6;
  --color-border: #d9cbe8;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --content-max-width: 72rem;
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 16px rgba(0,0,0,0.12);

  --header-height: 64px; /* mobile baseline */
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Base / reset */
*,
*::before,
*::after { box-sizing: border-box; }
html:focus-within { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
.container { width: min(var(--content-max-width), 100% - var(--space-6)); margin-inline: auto; }

/* Skip link */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-120%);
  background: var(--color-yellow);
  color: var(--color-text-on-yellow);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  z-index: 9999;
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px dashed var(--color-purple);
  outline-offset: 4px;
}

/* Focus styles */
a, button, input, textarea, select { outline-offset: 3px; }
:focus-visible { outline: 3px solid var(--color-yellow); }

/* Utility */
.sr-only {
  position: absolute !important; height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
.small-print { color: #4a3a5c; }
.badge {
  display: inline-block;
  background: var(--color-yellow);
  color: var(--color-text-on-yellow);
  border-radius: 999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
}
.kicker {
  margin: 0 0 var(--space-1) 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b5a7b;
  font-size: 0.8rem;
}
.back-to-top { margin-top: var(--space-6); }

/* Header (sticky) */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--color-purple);
  color: var(--color-text-on-purple);
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.brand {
  color: var(--color-text-on-purple);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.4px;
  font-size: 1.125rem;
}

/* Navigation */
.primary-nav {
  position: absolute;
  left: 0; right: 0;
  top: var(--header-height);
  background: var(--color-purple);
  transform: translateY(-8px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms step-end;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.site-header[data-menu-open="true"] .primary-nav { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }

.nav-list {
  list-style: none; padding: var(--space-3) var(--space-4); margin: 0;
  display: grid; gap: var(--space-2);
}
.nav-list a {
  color: var(--color-text-on-purple);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}
.nav-list a:hover { background: rgba(255, 213, 79, 0.15); }
.nav-list a:focus-visible { background: rgba(255, 213, 79, 0.2); }

/* Mobile menu toggle */
.menu-toggle {
  display: inline-flex;
  align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-on-purple);
  cursor: pointer; font-weight: 600;
}
.menu-toggle:hover { border-color: rgba(255,255,255,0.35); }
.menu-toggle__icon { font-size: 1.25rem; }

@media (min-width: 768px) {
  :root { --header-height: 72px; }
  .primary-nav {
    position: static; background: transparent; transform: none;
    opacity: 1; visibility: visible; pointer-events: auto; box-shadow: none;
  }
  .nav-list { display: flex; gap: var(--space-4); padding: 0; }
  .nav-list a { padding: var(--space-2) var(--space-2); }
  .nav-list a:hover { background: rgba(255,255,255,0.15); }
  .menu-toggle { display: none; }
}

/* Layout offsets for sticky header */
main { padding-top: var(--header-height); }
section { scroll-margin-top: calc(var(--header-height) + 16px); }

/* Sections */
.section { padding-block: var(--space-7); }
.section__header { margin-bottom: var(--space-5); }
.section__title { margin: 0 0 var(--space-2) 0; font-size: 1.75rem; }
.section__intro { margin: 0; color: #3b2a4b; }

/* CTA buttons */
.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.75rem 1.125rem;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease, color 120ms ease, filter 120ms ease;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--color-yellow);
  color: var(--color-text-on-yellow);
  border-color: var(--color-yellow);
  box-shadow: 0 6px 14px rgba(255, 213, 79, 0.35);
}
.btn--primary:hover { filter: brightness(0.97); }
.btn--ghost {
  background: transparent;
  color: var(--color-purple);
  border-color: var(--color-purple);
}
.btn--ghost:hover { background: rgba(106, 27, 154, 0.08); }

/* Plan navigation */
.plan-nav {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.plan-nav__list {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: var(--space-3);
  flex-wrap: wrap;
}

/* Plan sections */
.plan-section { background: var(--color-surface); }
.plan--pro { background: var(--color-surface-strong); }

.plan-header {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: var(--space-3);
}
.plan-header__titles { display: grid; gap: var(--space-1); }
.plan-title { margin: 0; font-size: clamp(1.5rem, 3.5vw, 2rem); }
.plan-tagline { margin: 0; color: #4a3a5c; }
.plan-header__price { margin-left: auto; }
.price-amount { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; color: var(--color-purple); }
.price-period, .price-note { margin: 0; color: #6b5a7b; }

@media (min-width: 860px) {
  .plan-header {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

/* Plan content grid */
.plan-section__grid {
  margin-top: var(--space-5);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
.plan-panel, .plan-aside {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.feature-list { padding-left: 1.25rem; }

@media (min-width: 720px) {
  .plan-section__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1040px) {
  .plan-section__grid { grid-template-columns: 2fr 2fr 1fr; }
  .plan-aside { grid-row: span 3; position: sticky; top: calc(var(--header-height) + var(--space-4)); }
}

/* Comparison table */
.table-wrap { overflow-x: auto; }
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.compare-table th,
.compare-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.compare-table thead th {
  background: var(--color-surface);
  text-align: left;
}
.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td { border-bottom: 0; }

/* Footer */
.site-footer {
  background: var(--color-purple);
  color: var(--color-text-on-purple);
  padding: var(--space-6) 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.footer-nav__list {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: var(--space-3);
}
.footer-nav__list a {
  color: var(--color-text-on-purple);
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}
.footer-nav__list a:hover { background: rgba(255,255,255,0.15); }
