.pricing-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f5ff 0%, #ffffff 100%);
  padding: var(--spacing-xl) var(--spacing-md);
}

.pricing-page .container {
  max-width: 850px;
  margin: 0 auto;
}

.pricing-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.pricing-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--spacing-sm);
}

.pricing-header p {
  font-size: var(--font-size-lg);
  color: var(--color-text-light);
}

.pricing-logo {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
}

[data-theme='dark'] .pricing-logo {
  color: #f5f5f5;
}

/* Toggle mensuel/annuel */
.plan-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}
.plan-toggle-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-light);
  cursor: pointer;
  transition: color 0.2s;
}
.plan-toggle-label.active {
  color: var(--color-text);
}
.plan-toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--color-border);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s;
}
.plan-toggle-switch.active {
  background: var(--color-primary);
}
.plan-toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}
.plan-toggle-switch.active::after {
  transform: translateX(22px);
}
.plan-savings-badge {
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
}

/* Story 16.5: Comparison Table */
.pricing-table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--spacing-lg);
  -webkit-overflow-scrolling: touch;
}

.pricing-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 600px;
}

.pricing-table th,
.pricing-table td {
  padding: 0.875rem 1.25rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.pricing-table th:first-child,
.pricing-table td:first-child {
  text-align: left;
  font-weight: 500;
}

/* Plan header cells */
.pricing-table thead th {
  vertical-align: top;
  padding-top: 1.5rem;
  padding-bottom: 1.25rem;
  background: var(--color-background);
  position: sticky;
  top: 0;
}

.pricing-table thead th:first-child {
  border-radius: var(--border-radius-lg) 0 0 0;
}

.pricing-table thead th:last-child {
  border-radius: 0 var(--border-radius-lg) 0 0;
}

.pricing-table thead th.col-pro {
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.08) 0%, transparent 100%);
  border-top: 3px solid var(--color-primary);
}

.plan-col-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.plan-col-badge {
  display: inline-block;
  background: linear-gradient(135deg, #611f69, #8b3a94);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.3rem;
  vertical-align: middle;
  text-transform: uppercase;
}

.plan-col-recommended {
  display: inline-block;
  background: linear-gradient(135deg, #611f69, #8b3a94);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

.plan-col-price {
  margin: 0.5rem 0;
}

.plan-col-price .amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.plan-col-price .currency {
  font-size: 0.9rem;
  font-weight: 600;
}

.plan-col-price .period {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.plan-col-savings {
  font-size: 0.8rem;
  color: var(--color-success, #10b981);
  font-weight: 500;
  min-height: 1.1em;
}

.plan-col-cta {
  margin-top: 0.75rem;
}

.btn-plan {
  padding: 0.6rem 1.5rem;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-plan-primary {
  background: var(--color-primary);
  color: white;
}
.btn-plan-primary:hover {
  opacity: 0.9;
}
.btn-plan-outline {
  background: transparent;
  border: 2px solid var(--color-primary) !important;
  color: var(--color-primary);
}
.btn-plan-outline:hover {
  background: var(--color-primary);
  color: white;
}

/* Feature rows */
.pricing-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.03);
}

.pricing-table .section-label {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-light);
  padding-top: 1.25rem;
  border-bottom: none;
}

.pricing-table .section-label td {
  border-bottom: none;
  padding-bottom: 0.25rem;
}

.feat-check {
  color: #10b981;
  font-size: 1.2rem;
  font-weight: 700;
}

.feat-cross {
  color: var(--color-text-light);
  font-size: 1rem;
}

.feat-text {
  font-size: 0.85rem;
  color: var(--color-text);
  font-weight: 500;
}

.col-pro {
  background: rgba(124, 58, 237, 0.03);
}

/* Dark mode */
[data-theme='dark'] .pricing-table thead th {
  background: #1e1e2e;
}
[data-theme='dark'] .pricing-table thead th.col-pro {
  background: rgba(124, 58, 237, 0.12);
}
[data-theme='dark'] .pricing-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.06);
}
[data-theme='dark'] .col-pro {
  background: rgba(124, 58, 237, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
  .pricing-table {
    min-width: 500px;
  }
  .plan-col-price .amount {
    font-size: 1.5rem;
  }
}

.error-message {
  background: #fef2f2;
  color: #991b1b;
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-md);
  display: none;
  text-align: center;
}

.plan-info {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: #f0fdf4;
  border-radius: var(--border-radius);
  color: #166534;
  font-size: 0.875rem;
  text-align: center;
}

.back-link {
  display: block;
  text-align: center;
  margin-top: var(--spacing-lg);
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

/* Dark Mode Toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: var(--color-text);
}

.theme-toggle .sun-icon {
  display: none;
}
.theme-toggle .moon-icon {
  display: block;
}

[data-theme='dark'] .theme-toggle .sun-icon {
  display: block;
}
[data-theme='dark'] .theme-toggle .moon-icon {
  display: none;
}

/* Dark Mode Styles */
[data-theme='dark'] .pricing-page {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

[data-theme='dark'] .pricing-header h1 {
  color: #f5f5f5;
}

[data-theme='dark'] .pricing-header p {
  color: #a0a0a0;
}

[data-theme='dark'] .plan-card {
  background: var(--color-background);
}

[data-theme='dark'] .plan-savings-badge {
  background: #064e3b;
  color: #6ee7b7;
}

[data-theme='dark'] .plan-info {
  background: #1a3d1a;
  color: #4ade80;
}

[data-theme='dark'] .back-link {
  color: var(--color-primary);
}

[data-theme='dark'] .theme-toggle {
  background: #2d2d44;
  border-color: #3d3d5c;
}

[data-theme='dark'] .theme-toggle svg {
  fill: #f5f5f5;
}

[data-theme='dark'] .error-message {
  background: #3b1a1a;
  color: #fca5a5;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Logo with icon */
.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Responsive */
@media (max-width: 768px) {
  .plan-cards {
    grid-template-columns: 1fr;
  }
  .pricing-header h1 {
    font-size: 2rem;
  }
}
