/* ============================================
   Aurora — Commerce pages
   Shared styles for: pricing, checkout-success,
   refund-policy, license-help, account, upgrade.

   These pages are all "document-y": a hero, then
   long-form content in a narrow column. They lean
   on the tokens in styles.css and only define the
   shapes that don't already exist elsewhere.
   ============================================ */

/* --- Hero title + subtitle ----------------------------------------
   Shared by every commerce page. Reuses the hero ambient background
   from the fixed body::before layer — no section background here.
-------------------------------------------------------------------- */
.commerce-hero__title {
  font-size: var(--text-hero-desktop);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
  margin: 0 0 var(--space-5);
}
.commerce-hero__subtitle {
  font-size: var(--text-hero-body-desktop);
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 640px;
  margin: 0 auto;
}

/* Trust-chip row under the hero (VAT included · 14-day refund · …) */
.commerce-hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: var(--space-6);
}
.commerce-hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-soft);
  font-size: var(--text-small);
  color: var(--text-secondary);
  line-height: 1;
}
.commerce-hero__chip svg { color: var(--accent-green); }
[data-theme="light"] .commerce-hero__chip {
  background: rgba(255,255,255,0.7);
  border-color: rgba(0,0,0,0.06);
}

/* --- Long-form content column ------------------------------------
   For refund-policy, license-help etc. A narrow reading column
   with comfortable line-height and clear heading hierarchy.
-------------------------------------------------------------------- */
.commerce-prose {
  max-width: 720px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}
.commerce-prose > * + * { margin-top: var(--space-4); }
.commerce-prose h2 {
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}
.commerce-prose h2:first-child { margin-top: 0; }
.commerce-prose h3 {
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}
.commerce-prose p { margin: 0; }
.commerce-prose a {
  color: var(--accent-green);
  text-decoration: underline;
  text-decoration-color: rgba(52,211,153,0.4);
  text-underline-offset: 3px;
}
.commerce-prose ul,
.commerce-prose ol {
  padding-left: var(--space-6);
  margin: 0;
}
.commerce-prose li { margin-bottom: var(--space-2); }
.commerce-prose li::marker { color: var(--accent-green); }
.commerce-prose strong { color: var(--text-primary); font-weight: 600; }
.commerce-prose code {
  background: rgba(52,211,153,0.08);
  color: var(--text-primary);
  border: 1px solid rgba(52,211,153,0.15);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 14px;
}

/* Callout box — used for "last updated" stamps, notes, warnings. */
.commerce-callout {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.commerce-callout--info {
  border-color: rgba(56,189,248,0.25);
  background: linear-gradient(180deg, rgba(56,189,248,0.06), rgba(56,189,248,0));
}

/* Compact trust cards for commerce flows. These sit between the plan cards
   and activation/support instructions, making the purchase handoff feel
   concrete without adding another heavy page section. */
.commerce-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  max-width: 980px;
  margin: var(--space-8) auto 0;
}
.commerce-proof-grid--wide {
  max-width: 1080px;
}
.commerce-proof {
  padding: var(--space-5);
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025)),
    var(--surface-card);
  border: 1px solid var(--border-soft);
  min-height: 154px;
}
.commerce-proof__icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-4);
  border-radius: 10px;
  color: var(--accent-green);
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.22);
  font-size: 13px;
  font-weight: 800;
}
.commerce-proof strong {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.3;
  margin-bottom: var(--space-2);
}
.commerce-proof p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}
[data-theme="light"] .commerce-proof {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.6)),
    var(--surface-card);
}
@media (max-width: 820px) {
  .commerce-proof-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .commerce-proof {
    min-height: 0;
  }
}

/* --- Activation steps --------------------------------------------------
   Three numbered cards (used on /license.html "Activate in three steps").
   Replaces a flat <ol> with a richer visual grid so the activation flow
   reads as its own component, not just body copy.
-------------------------------------------------------------------------- */
.activate-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin: 0 0 var(--space-5);
  list-style: none;
  padding: 0;
  counter-reset: activate-step;
}
.activate-steps__item {
  position: relative;
  padding: var(--space-5);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
}
.activate-steps__item:hover {
  border-color: rgba(52, 211, 153, 0.35);
  transform: translateY(-2px);
}
.activate-steps__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent-green);
  font-family: var(--font-rounded, var(--font-heading));
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(52, 211, 153, 0.28);
  margin-bottom: var(--space-1);
}
.activate-steps__title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0;
}
.activate-steps__body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}
.activate-steps__body strong {
  color: var(--text-primary);
  font-weight: 600;
}
@media (max-width: 720px) {
  .activate-steps {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}
@media (prefers-reduced-motion: reduce) {
  .activate-steps__item { transition: none; }
  .activate-steps__item:hover { transform: none; }
}

/* --- License hero skip-link --------------------------------------------
   "Already have a key?" anchor chip in the hero meta row. Reads as an
   inline link-button, not another chip, so users spot the escape hatch
   straight away.
-------------------------------------------------------------------------- */
.commerce-hero__skip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-3);
  font-size: 14px;
  color: var(--accent-green);
  text-decoration: none;
  border-bottom: 1px solid rgba(52, 211, 153, 0.3);
  padding-bottom: 2px;
  transition: border-color var(--dur-fast) var(--ease);
}
.commerce-hero__skip:hover,
.commerce-hero__skip:focus-visible {
  border-bottom-color: var(--accent-green);
}
.commerce-hero__skip svg { flex-shrink: 0; }

/* Product-plan symbols used on commerce cards. They read closer to macOS
   app badges than plain line icons, while keeping the markup lightweight. */
.plan-card__name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-card__icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-block;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
}
.plan-card__icon::before,
.plan-card__icon::after {
  content: "";
  position: absolute;
  display: block;
  box-sizing: border-box;
}
.plan-card__icon--trial {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--surface-card) 0 42%, transparent 43%),
    conic-gradient(var(--accent-green) 0.75turn, rgba(255,255,255,0.16) 0);
  border: 1px solid rgba(52,211,153,0.32);
}
.plan-card__icon--trial::before {
  left: 8px;
  top: 4px;
  width: 2px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: 1px 5px;
  transform: rotate(125deg);
}
.plan-card__icon--monthly {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.92) 0 10%, transparent 11%),
    linear-gradient(135deg, #34d399, #38bdf8 60%, #a78bfa);
}
.plan-card__icon--monthly::before {
  left: 8px;
  top: 3px;
  width: 2px;
  height: 12px;
  border-radius: 999px;
  background: #fff;
}
.plan-card__icon--monthly::after {
  left: 3px;
  top: 8px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}
.plan-card__icon--lifetime {
  clip-path: polygon(50% 4%, 90% 22%, 90% 50%, 82% 70%, 64% 88%, 50% 98%, 36% 88%, 18% 70%, 10% 50%, 10% 22%);
  background: linear-gradient(150deg, #facc15, #34d399 58%, #0f766e);
}
.plan-card__icon--lifetime::before {
  left: 5px;
  top: 7px;
  width: 8px;
  height: 5px;
  border-left: 2px solid rgba(255,255,255,0.95);
  border-bottom: 2px solid rgba(255,255,255,0.95);
  transform: rotate(-45deg);
}

/* --- Success page --------------------------------------------------
   checkout-success has a large check mark + receipt card + next-steps
   list. The green aurora ring is the hero's moment of celebration.
-------------------------------------------------------------------- */
.success-ring {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-6);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(52,211,153,0.55), rgba(56,189,248,0.25) 55%, transparent 80%),
    rgba(52,211,153,0.08);
  border: 1px solid rgba(52,211,153,0.35);
  box-shadow:
    0 0 0 6px rgba(52,211,153,0.06),
    0 0 40px rgba(52,211,153,0.18);
  position: relative;
}
.success-ring svg {
  width: 42px; height: 42px;
  color: var(--accent-green);
  stroke-width: 2.4;
}
@keyframes success-ring-pulse {
  0%   { box-shadow: 0 0 0 6px rgba(52,211,153,0.06), 0 0 40px rgba(52,211,153,0.18); }
  50%  { box-shadow: 0 0 0 10px rgba(52,211,153,0.10), 0 0 60px rgba(52,211,153,0.28); }
  100% { box-shadow: 0 0 0 6px rgba(52,211,153,0.06), 0 0 40px rgba(52,211,153,0.18); }
}
.success-ring { animation: success-ring-pulse 3.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .success-ring { animation: none; } }

/* Receipt-style card: email, license key, CTA. */
.receipt-card {
  max-width: 560px;
  margin: var(--space-6) auto 0;
  padding: var(--space-6);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  text-align: left;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 14px;
}
.receipt-row:last-child { border-bottom: 0; }
.receipt-row__label { color: var(--text-muted); }
.receipt-row__value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}
.receipt-row__value code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  background: rgba(52,211,153,0.08);
  border: 1px solid rgba(52,211,153,0.15);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
}

/* Next-steps grid — numbered cards guiding the user post-purchase. */
.next-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  max-width: 960px;
  margin: var(--space-10) auto 0;
}
.next-step {
  padding: var(--space-5);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  position: relative;
}
.next-step__num {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.3);
  color: var(--accent-green);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: var(--space-3);
}
.next-step__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-2);
}
.next-step__body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}
.next-step__link {
  display: inline-block;
  margin-top: var(--space-3);
  font-size: 14px;
  color: var(--accent-green);
  text-decoration: underline;
  text-decoration-color: rgba(52,211,153,0.4);
  text-underline-offset: 3px;
}

/* --- License help: resend-key form ------------------------------- */
.resend-form {
  max-width: 520px;
  margin: var(--space-5) auto 0;
  padding: var(--space-5);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  display: grid;
  gap: var(--space-3);
}
.resend-form label {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.resend-form input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  font: inherit;
  font-size: 15px;
}
.resend-form input[type="email"]:focus {
  outline: none;
  border-color: rgba(52,211,153,0.5);
  box-shadow: 0 0 0 3px rgba(52,211,153,0.15);
}
[data-theme="light"] .resend-form input[type="email"] {
  background: rgba(255,255,255,0.9);
  border-color: rgba(0,0,0,0.1);
}
.resend-form__hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Status message shown after form submit. */
.resend-status {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  display: none;
}
.resend-status.is-visible { display: block; }
.resend-status--ok {
  background: rgba(52,211,153,0.08);
  border: 1px solid rgba(52,211,153,0.28);
  color: var(--text-primary);
}
.resend-status--err {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.28);
  color: var(--text-primary);
}

/* --- Upgrade page: feature strip --------------------------------- */
.upgrade-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  max-width: 880px;
  margin: var(--space-8) auto;
}
.upgrade-feature {
  padding: var(--space-5);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
}
.upgrade-feature__icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(52,211,153,0.1);
  color: var(--accent-green);
  margin-bottom: var(--space-3);
}
.upgrade-feature__icon svg { width: 20px; height: 20px; }
.upgrade-feature__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
}
.upgrade-feature__body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* --- Account router: single button that opens LS portal ---------- */
.account-router {
  max-width: 560px;
  margin: var(--space-6) auto 0;
  padding: var(--space-6);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  text-align: left;
  display: grid;
  gap: var(--space-4);
}
.account-router p { margin: 0; color: var(--text-secondary); font-size: 15px; line-height: 1.6; }
.account-router__list {
  margin: 0; padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.account-router__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}
.account-router__list li svg { color: var(--accent-green); flex-shrink: 0; }

/* --- Small shared helpers --------------------------------------- */
/* Sits directly under the plan grid — slightly more weight than the
   VAT note since it's a real positioning statement (Monthly == Lifetime
   feature-wise). */
.plans-explainer {
  max-width: 620px;
  margin: var(--space-6) auto 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.plans-vat-note {
  max-width: 620px;
  margin: var(--space-3) auto 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.plans-footer {
  max-width: 620px;
  margin: var(--space-7, 1.75rem) auto 0;
  padding: 0;
  text-align: center;
}

.plans-footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin: var(--space-4) auto 0;
  text-align: center;
}

.plans-footer-links .commerce-hero__skip {
  justify-content: center;
  margin-top: 0;
}

.plans-footer-links .commerce-hero__skip + .commerce-hero__skip {
  margin-top: var(--space-3);
}

.pricing-trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  max-width: 980px;
  margin: var(--space-8) auto var(--space-5);
}

.pricing-trust-card {
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card-sm);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025)),
    rgba(255,255,255,0.02);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.pricing-trust-card__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-3);
  border-radius: 10px;
  color: var(--accent-green);
  background: rgba(52,211,153,0.10);
  border: 1px solid rgba(52,211,153,0.22);
}

.pricing-trust-card strong {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.25;
  margin-bottom: var(--space-2);
}

.pricing-trust-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.55;
}

[data-theme="light"] .pricing-trust-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.58)),
    rgba(255,255,255,0.66);
}

/* --- Responsive ------------------------------------------------- */
@media (max-width: 768px) {
  .commerce-hero__title { font-size: var(--text-hero-mobile); }
  .commerce-hero__subtitle { font-size: var(--text-hero-body-mobile); }
  .pricing-trust-grid { grid-template-columns: 1fr; }
  .receipt-row { flex-direction: column; gap: 4px; }
  .receipt-row__value { text-align: left; }
}
