/* pricing.css — Zodaiya Pricing page styles */

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --accent: var(--color-accent, #a78bfa);
  --accent-glow: var(--color-accent-glow, rgba(167, 139, 250, 0.35));
  --bg: var(--color-bg, #0d0d1a);
  --surface: var(--color-surface, rgba(255, 255, 255, 0.04));
  --border: var(--color-border, rgba(255, 255, 255, 0.1));
  --text: var(--color-text, #e2e8f0);
  --text-muted: var(--color-text-muted, #94a3b8);
  --success: var(--color-success, #34d399);
  --gold: #d4a843;
  --gold-dark: #d97706;
  --radius: 12px;
}

/* ── Page Layout ────────────────────────────────────────────────────────────── */
.pricing-page {
  max-width: 1060px;
  margin: 0 auto;
  padding: 2.5rem 1rem 5rem;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.pricing-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.pricing-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pricing-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
}

/* ── Billing Toggle ─────────────────────────────────────────────────────────── */
.billing-toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  margin-bottom: 3rem;
}

.toggle-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.billing-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  background: var(--border);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.25s;
  flex-shrink: 0;
}

.billing-toggle[aria-checked="true"] {
  background: var(--accent);
}

.billing-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.billing-toggle[aria-checked="true"] .billing-toggle-thumb {
  transform: translateX(24px);
}

.save-badge {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Pricing Cards Grid ─────────────────────────────────────────────────────── */
.pricing-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2rem;
}

/* ── Glass Card ─────────────────────────────────────────────────────────────── */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.75rem;
}

/* ── Individual Pricing Card ────────────────────────────────────────────────── */
.pricing-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Pro card — larger, gold border, on top on mobile */
.card-pro {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(
    160deg,
    rgba(245, 158, 11, 0.06) 0%,
    var(--surface) 60%
  );
  padding-top: 2.75rem; /* room for Most Popular badge */
  overflow: visible;
}

.card-pro:hover {
  box-shadow: 0 12px 40px rgba(245, 158, 11, 0.15);
}

/* Most Popular badge */
.most-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 1rem;
  border-radius: 0 0 8px 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.card-tier-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.card-price {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.price-amount {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

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

.yearly-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: -0.75rem;
}

.card-tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* ── Feature List ───────────────────────────────────────────────────────────── */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.feature-item {
  font-size: 0.88rem;
  color: var(--text);
  padding-left: 1.4rem;
  position: relative;
  line-height: 1.4;
}

.feature-item::before {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.85rem;
}

.feature-item.included::before {
  content: '✓';
  color: var(--success);
}

.feature-item.excluded::before {
  content: '–';
  color: var(--text-muted);
}

.feature-item.muted {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.feature-item.muted::before {
  display: none;
}

/* ── CTA Buttons ────────────────────────────────────────────────────────────── */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, box-shadow 0.2s, background 0.2s;
  text-decoration: none;
}

.btn-cta:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-cta-primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
}

.btn-cta-primary:hover:not(:disabled) {
  opacity: 0.9;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-cta-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-cta-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.btn-cta-pro {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: white;
}

.btn-cta-pro:hover:not(:disabled) {
  opacity: 0.9;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
}

.btn-cta-current {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
}

.btn-cta-confirm {
  border: 1px solid rgba(251, 191, 36, 0.8) !important;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2), 0 0 20px rgba(251, 191, 36, 0.28);
}

/* Current plan card highlight */
.pricing-card.is-current-plan {
  border-color: rgba(167, 139, 250, 0.4);
}

/* ── Current Plan Banner ────────────────────────────────────────────────────── */
#current-plan,
.current-plan-banner {
  min-height: 0;
}

.current-plan-banner {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.current-plan-banner strong {
  color: var(--accent);
}

/* ── Error / sign-in messages ───────────────────────────────────────────────── */
.signin-required-msg,
.cta-error-msg,
.downgrade-required-msg {
  font-size: 0.82rem;
  color: var(--error, #f87171);
  text-align: center;
  margin: 0.5rem 0 0;
  padding: 0.62rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.38);
  background: rgba(127, 29, 29, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.downgrade-required-msg {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(120, 53, 15, 0.26);
}

.signin-jump-link {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.error-dismiss {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

/* ── Section Titles ─────────────────────────────────────────────────────────── */
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 1.75rem;
}

/* ── Comparison Table ───────────────────────────────────────────────────────── */
.comparison-section {
  margin-top: 4rem;
}

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

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.comparison-table thead tr {
  background: rgba(255, 255, 255, 0.05);
}

.comparison-table th {
  padding: 1rem 1.25rem;
  text-align: center;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.comparison-table th:first-child {
  text-align: left;
}

.comparison-table td {
  padding: 0.75rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.comparison-table td:first-child {
  text-align: left;
  color: var(--text);
}

/* Striped rows */
.comparison-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.comparison-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.check {
  color: var(--success);
  font-size: 1rem;
  font-weight: 700;
}

.cross {
  color: var(--text-muted);
  font-size: 0.9rem;
  opacity: 0.5;
}

/* ── FAQ Section ────────────────────────────────────────────────────────────── */
.faq-section {
  margin-top: 4rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item[open] {
  border-color: rgba(167, 139, 250, 0.3);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: color 0.15s;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item[open] .faq-question::after {
  transform: rotate(45deg);
}

.faq-question:hover {
  color: var(--accent);
}

.faq-answer {
  padding: 0 1.25rem 1rem;
  border-top: 1px solid var(--border);
}

.faq-answer p {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .pricing-cards-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Pro card on top on mobile */
  .pricing-cards-grid {
    display: flex;
    flex-direction: column;
  }

  .pricing-cards-grid .card-pro {
    order: -1;
  }
}

@media (max-width: 520px) {
  .pricing-header h1 {
    font-size: 1.75rem;
  }

  .price-amount {
    font-size: 2rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.82rem;
  }
}

/* ── Sticky comparison table header on mobile ───────────────────────────────── */
@media (max-width: 768px) {
  .comparison-table thead,
  .feature-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface, #12122a);
  }
  .comparison-table th,
  .feature-table th {
    background: var(--surface, #12122a);
  }
}

/* ── FAQ reorder on mobile ──────────────────────────────────────────────────── */
/* NOTE: order only works if .pricing-page is flex/grid. If FAQ doesn't move,
   reordering must happen in the server-rendered HTML instead. */
@media (max-width: 768px) {
  .pricing-faq, .faq-section {
    order: -1;
    margin-top: 2rem;
  }
}

/* ── Savings Badge ──────────────────────────────────────────────────────────── */
.savings-badge {
  display: inline-block;
  background: linear-gradient(135deg, #d4a843, #f0c060);
  color: #0a0a1a;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ── Currency Note ──────────────────────────────────────────────────────────── */
.currency-note {
  text-align: center;
  color: var(--text-muted, #c4c4e0);
  font-size: 0.8rem;
  margin-top: 2rem;
  opacity: 0.8;
}

/* ── Button Spinner ─────────────────────────────────────────────────────────── */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Mobile Responsive: Tablet / Small screens ──────────────────────────────── */
@media (max-width: 768px) {
  .pricing-page {
    padding: 1.5rem 0.75rem 3rem;
  }

  .pricing-header {
    margin-bottom: 1.5rem;
  }

  .pricing-header h1 {
    font-size: 1.85rem;
  }

  .pricing-subtitle {
    font-size: 0.95rem;
  }

  /* Billing toggle — full width row */
  .billing-toggle-wrapper {
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: 2rem;
    width: 100%;
  }

  /* Pricing cards — single column */
  .pricing-cards-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    gap: 1.25rem;
  }

  /* Glass card padding */
  .glass-card {
    padding: 1.25rem;
  }

  /* Most Popular badge — prevent clipping */
  .most-popular-badge {
    font-size: 0.68rem;
    padding: 0.25rem 0.75rem;
    max-width: calc(100% - 2rem);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card-pro {
    padding-top: 2.25rem;
  }

  /* Price sizing */
  .price-amount {
    font-size: 2.25rem;
  }

  /* CTA buttons — full width */
  .btn-cta {
    width: 100%;
    padding: 0.8rem 1.25rem;
    font-size: 0.9rem;
  }

  /* Section titles */
  .section-title {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
  }

  /* Comparison section */
  .comparison-section {
    margin-top: 2.5rem;
  }

  /* FAQ */
  .faq-section {
    margin-top: 2.5rem;
  }

  .faq-question {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }

  .faq-answer {
    padding: 0 1rem 0.875rem;
  }

  .faq-answer p {
    font-size: 0.85rem;
  }
}

/* ── Mobile Responsive: Small phones ────────────────────────────────────────── */
@media (max-width: 480px) {
  .pricing-page {
    padding: 1rem 0.5rem 2rem;
  }

  .pricing-header h1 {
    font-size: 1.5rem;
  }

  .pricing-subtitle {
    font-size: 0.85rem;
  }

  /* Billing toggle — stack vertically */
  .billing-toggle-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .toggle-label {
    font-size: 0.85rem;
  }

  /* Cards — tight padding */
  .pricing-cards-grid {
    max-width: 100%;
    gap: 1rem;
  }

  .glass-card {
    padding: 1rem;
    border-radius: 10px;
  }

  .pricing-card {
    gap: 1rem;
  }

  /* Most Popular badge — safe on small screens */
  .most-popular-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0 0 6px 6px;
  }

  .card-pro {
    padding-top: 2rem;
  }

  /* Typography adjustments */
  .card-tier-label {
    font-size: 1rem;
  }

  .price-amount {
    font-size: 1.85rem;
  }

  .price-period {
    font-size: 0.78rem;
  }

  .card-tagline {
    font-size: 0.82rem;
  }

  .feature-item {
    font-size: 0.82rem;
    padding-left: 1.2rem;
  }

  /* CTA buttons — full width, comfortable tap target */
  .btn-cta {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    border-radius: 10px;
  }

  /* Section titles */
  .section-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  /* Comparison table — tighter */
  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem 0.5rem;
    font-size: 0.78rem;
  }

  /* FAQ — tighter */
  .faq-question {
    padding: 0.75rem 0.875rem;
    font-size: 0.85rem;
    gap: 0.5rem;
  }

  .faq-answer p {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  /* Currency note */
  .currency-note {
    font-size: 0.72rem;
    margin-top: 1.25rem;
  }

  /* Savings badge */
  .savings-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
  }
}
