:root {
  --bg: #f5f5f1;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --text: #182231;
  --muted: #677485;
  --line: rgba(24, 34, 49, 0.1);
  --line-strong: rgba(24, 34, 49, 0.18);
  --coral: #ff7248;
  --coral-soft: rgba(255, 114, 72, 0.16);
  --sky: #2ea8ff;
  --sky-soft: rgba(46, 168, 255, 0.14);
  --mint: #79cf72;
  --gold: #ffc95f;
  --danger: #b54427;
  --shadow: 0 18px 42px rgba(24, 34, 49, 0.08);
  --shadow-strong: 0 30px 72px rgba(24, 34, 49, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --content-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Instrument Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 114, 72, 0.12), transparent 26%),
    radial-gradient(circle at top right, rgba(46, 168, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #fcfcfa 0%, #f7f7f3 48%, #f1f2ee 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  padding-bottom: 32px;
}

.topbar,
.hero,
.section,
.success-layout {
  width: min(calc(100% - 24px), var(--content-width));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--coral), var(--gold), var(--sky));
  box-shadow: 0 14px 28px rgba(46, 168, 255, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong {
  font-family: "Fraunces", serif;
  font-size: 1.18rem;
  line-height: 1;
}

.brand-text span,
.topbar-nav a,
.text-link,
.hero-note small,
.hero-text,
.summary-eta,
.status-banner,
.success-intro,
.timeline p,
.status-card span,
.license-card-body p,
.turnstile-head span,
.order-card-title p,
.order-code-empty,
.empty-state {
  color: var(--muted);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-nav a {
  font-size: 0.94rem;
}

.hero {
  padding: 42px 0 10px;
}

.compact-hero {
  padding-bottom: 2px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--coral);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.hero h1,
.section h2,
.success-panel h1,
.result-header h2,
.checkout-summary h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  letter-spacing: -0.04em;
  color: var(--text);
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 0.97;
}

.hero-text,
.checkout-summary p,
.success-intro,
.timeline p,
.license-card-body p {
  line-height: 1.65;
}

.hero-text {
  margin: 16px 0 0;
  max-width: 620px;
  font-size: 1.02rem;
}

.hero-note,
.checkout-summary,
.checkout-form,
.success-panel,
.result-panel,
.status-card,
.license-card,
.order-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-note {
  width: fit-content;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
}

.hero-note span,
.hero-note strong,
.license-card label,
.turnstile-head strong,
.order-code-block label {
  display: block;
}

.hero-note strong,
.summary-price strong,
.eta-copy strong,
.status-card strong,
.license-code {
  margin-top: 4px;
  font-size: 1.35rem;
  font-weight: 700;
}

.section {
  padding-top: 22px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.is-hidden {
  display: none;
}

.section h2,
.success-panel h1,
.result-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 245, 0.92));
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.product-card:hover,
.product-card.selected {
  transform: translateY(-3px);
  box-shadow: var(--shadow-strong);
}

.product-card.selected {
  border-color: rgba(46, 168, 255, 0.34);
}

.price-row,
.summary-price,
.result-header,
.order-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.product-tag,
.status-pill,
.success-badge,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  width: fit-content;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.product-tag,
.status-pill {
  background: rgba(24, 34, 49, 0.06);
}

.success-badge {
  color: var(--sky);
  background: var(--sky-soft);
}

.status-chip {
  color: var(--text);
  background: rgba(24, 34, 49, 0.06);
}

.status-chip[data-state="fulfilled"] {
  color: #1e6b2e;
  background: rgba(121, 207, 114, 0.2);
}

.status-chip[data-state="failed"] {
  color: var(--danger);
  background: rgba(255, 114, 72, 0.16);
}

.status-chip[data-state="paid"] {
  color: #7f5a06;
  background: rgba(255, 201, 95, 0.22);
}

.product-card[data-tone="coral"] .product-tag,
.product-card[data-tone="coral"] .price-value {
  color: var(--coral);
}

.product-card[data-tone="sky"] .product-tag,
.product-card[data-tone="sky"] .price-value {
  color: var(--sky);
}

.product-title {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.03;
}

.product-desc {
  margin: 0;
  min-height: 52px;
  color: var(--muted);
  line-height: 1.6;
}

.price-value {
  font-size: 2rem;
  line-height: 1;
}

.price-unit {
  color: var(--muted);
}

.product-meta {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.product-meta li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
}

.product-meta li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--coral));
  flex: 0 0 auto;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--coral), #ff9757 48%, var(--sky));
  box-shadow: 0 16px 32px rgba(255, 114, 72, 0.22);
}

.button-secondary {
  color: var(--text);
  background: rgba(24, 34, 49, 0.06);
  border: 1px solid var(--line);
  box-shadow: none;
}

.button[disabled] {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.full-width {
  width: 100%;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dual-actions .button-secondary {
  flex: 0 0 auto;
}

.checkout-back-button {
  white-space: nowrap;
}

.mobile-only {
  display: none;
}

.checkout-layout,
.success-layout,
.lookup-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(0, 1.12fr);
  gap: 16px;
}

.checkout-summary,
.checkout-form,
.success-panel,
.result-panel {
  padding: 20px;
  border-radius: var(--radius-xl);
}

.checkout-summary {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 245, 0.92));
  box-shadow: var(--shadow-strong);
  border: 2px solid rgba(46, 168, 255, 0.42);
  position: relative;
}

.checkout-summary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(46, 168, 255, 0.14);
  pointer-events: none;
}

.checkout-summary p {
  margin: 0;
  min-height: 52px;
  color: var(--muted);
  line-height: 1.6;
}

.summary-head,
.summary-eta {
  margin-bottom: 12px;
}

.summary-head {
  margin-bottom: 0;
}

.checkout-summary .status-pill {
  background: rgba(46, 168, 255, 0.12);
  color: var(--sky);
}

.checkout-summary h3 {
  font-size: 1.6rem;
  line-height: 1.03;
}

.checkout-summary .summary-price strong {
  font-size: 2rem;
  line-height: 1;
  color: var(--sky);
}

.checkout-summary .summary-price span {
  color: var(--muted);
}

.checkout-summary .summary-eta {
  margin: 0;
  padding-top: 2px;
  font-size: 0.95rem;
}

.checkout-summary .product-meta {
  margin-top: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.form-field span {
  font-size: 0.92rem;
}

.form-field input {
  min-height: 48px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-field input:focus {
  border-color: rgba(46, 168, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(46, 168, 255, 0.1);
}

.turnstile-wrap {
  margin: 8px 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 249, 245, 0.9);
}

.turnstile-head {
  margin-bottom: 10px;
}

.turnstile-box {
  min-height: 70px;
}

.turnstile-placeholder {
  display: grid;
  place-items: center;
  min-height: 62px;
  padding: 0 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.status-banner {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(24, 34, 49, 0.05);
  line-height: 1.55;
}

.status-banner[data-mode="ready"] {
  background: var(--sky-soft);
}

.status-banner[data-mode="loading"] {
  background: rgba(255, 201, 95, 0.2);
}

.status-banner[data-mode="error"] {
  color: var(--danger);
  background: var(--coral-soft);
}

.success-shell {
  padding-top: 8px;
}

.eta-panel {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.92));
}

.eta-meter {
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  background: rgba(24, 34, 49, 0.08);
  overflow: hidden;
}

.eta-fill {
  width: 14%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--sky));
  transition: width 260ms ease;
}

.status-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.status-card {
  padding: 14px;
  border-radius: var(--radius-md);
}

.status-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.02rem;
}

.timeline {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 12px;
}

.timeline-item span {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 50%;
  background: rgba(24, 34, 49, 0.16);
}

.timeline-item.complete span {
  background: var(--mint);
}

.timeline-item.active span {
  background: var(--gold);
}

.timeline-item.pending-ready span {
  background: var(--sky);
}

.timeline strong {
  display: block;
  margin-bottom: 4px;
}

.license-card {
  padding: 16px;
  border-radius: var(--radius-lg);
}

.license-card.ready {
  box-shadow: var(--shadow-strong);
}

.license-card-top {
  margin-bottom: 12px;
  font-weight: 600;
}

.license-card-body {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
}

.license-code,
.order-code-item,
.order-code-empty {
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  word-break: break-all;
}

.license-code {
  letter-spacing: 0.08em;
  font-size: 1rem;
}

.order-results {
  display: grid;
  gap: 14px;
}

.order-card {
  padding: 18px;
  border-radius: var(--radius-lg);
}

.order-card-title h3 {
  margin: 0;
  font-size: 1.15rem;
}

.order-card-title p {
  margin: 6px 0 0;
  font-size: 0.9rem;
}

.order-meta-grid {
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.order-meta-item {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(24, 34, 49, 0.04);
}

.order-meta-item dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.order-meta-item dd {
  margin: 8px 0 0;
  font-size: 0.96rem;
  font-weight: 600;
}

.order-code-block {
  margin-top: 14px;
}

.order-code-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.order-fail-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--coral-soft);
  color: var(--danger);
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
}

.confetti-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-field span {
  position: absolute;
  top: -10vh;
  width: 8px;
  height: 18px;
  border-radius: 999px;
  opacity: 0.84;
  animation: confettiDrop linear forwards;
}

.purchase-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  max-width: 320px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-strong);
}

@keyframes confettiDrop {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  100% {
    transform: translate3d(var(--drift, 0px), 115vh, 0) rotate(520deg);
  }
}

@media (max-width: 920px) {
  .topbar,
  .hero,
  .section,
  .success-layout {
    width: min(calc(100% - 16px), var(--content-width));
  }

  .product-grid,
  .checkout-layout,
  .success-layout,
  .lookup-layout,
  .status-grid,
  .form-grid,
  .order-meta-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .section-head,
  .result-header,
  .order-card-head {
    align-items: start;
    flex-direction: column;
  }

  .checkout-back-button {
    display: none;
  }

  .mobile-only {
    display: inline-flex;
  }

  .form-actions {
    flex-direction: column;
  }
}
