.checkout-page {
  --action-bg: #175d46;
  --action-fg: #fff;
  --error: #a3362d;
  --soft-edge: #dfe5da;
  --ticket-edge: #cbd4c8;
  --dot-ink: #b7c7ad;
  --input-ink: #6a7974;
  min-height: 100vh;
}
html[data-theme="dark"] .checkout-page {
  --action-bg: #b9e9b1;
  --action-fg: #122e25;
  --error: #ffb3a5;
  --soft-edge: #34443b;
  --ticket-edge: #3b5144;
  --dot-ink: #49634e;
  --input-ink: #a4b4ab;
}
.checkout-page input, .checkout-page button { font-family: inherit; }
.checkout-page .assistive {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.checkout-wrap { width: min(100% - 5rem, 72rem); margin-inline: auto; }
.checkout-nav, .checkout-nav-actions { display: flex; align-items: center; }
.checkout-nav { min-height: var(--mast-height); justify-content: space-between; gap: 1rem; }
.checkout-nav .brand { width: 9.1rem; }
.checkout-nav-actions { gap: .7rem; }
.home-link { font-weight: 570; font-size: .94rem; margin-right: 1.1rem; }
.home-link:hover, .demo-fill:hover { text-decoration: underline; text-underline-offset: .2em; }
.preview-tools {
  display: inline-flex; align-items: center; gap: .48rem; min-height: 2.65rem; padding: .4rem .87rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--wash);
  font-size: .9rem; font-weight: 630; color: var(--green);
}
.preview-tools .icon { width: 1rem; height: 1rem; }
.preview-tools:hover { border-color: var(--green); }
.checkout-grid {
  display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
  grid-template-areas: "intro receipt" "form receipt";
  column-gap: clamp(3rem, 6.3vw, 6rem); align-items: start;
  padding-block: clamp(2.6rem, 4.3vw, 4.25rem) 3rem;
}
.checkout-intro { grid-area: intro; min-width: 0; }
.checkout-intro .kicker { font-size: .78rem; }
.checkout-intro h1 {
  margin: .65rem 0 .55rem; font-size: clamp(3.15rem, 5.35vw, 5rem); line-height: .99;
  font-weight: 600; letter-spacing: -.075em;
}
.checkout-intro h1 em, .cover-content h2 em { font-family: var(--serif); font-weight: 400; }
.checkout-intro h1 em { color: var(--green); letter-spacing: -.046em; }
.checkout-intro > p:last-child { color: var(--muted); font-size: 1.04rem; line-height: 1.55; }
.order-column { grid-area: receipt; min-width: 0; position: relative; isolation: isolate; margin-top: .45rem; }
.order-column::before {
  content: ""; position: absolute; z-index: -1; inset: -1.65rem -1.5rem -1.25rem;
  background-image: radial-gradient(var(--dot-ink) 1px, transparent 1.2px); background-size: 10px 10px;
  mask-image: linear-gradient(125deg, transparent 6%, #000 52%, #000 84%, transparent);
}
.cohort-ticket {
  border: 1px solid var(--ticket-edge); background: var(--surface); border-radius: 1.1rem;
  box-shadow: 0 5px 0 -2px var(--mint), 0 6px 0 -2px var(--ticket-edge), 0 18px 35px -20px rgba(14,44,30,.36);
}
.ticket-cover {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 1.01rem 1.01rem 0 0;
  background: #10392e; color: #f7faf2; display: flex; align-items: end;
  min-height: 11.75rem;
}
.ticket-cover > img {
  position: absolute; inset: 0 0 0 auto; z-index: -2; width: 73%; height: 100%;
  object-fit: cover; object-position: 63% 48%;
}
.ticket-cover::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #10392e 9%, rgba(16,57,46,.99) 29%, rgba(16,57,46,.81) 56%, rgba(16,57,46,.19) 100%),
              linear-gradient(0deg, rgba(4,25,17,.47), transparent 72%);
}
.cover-content { position: relative; padding: 1.55rem 1.7rem 1.75rem; }
.cover-content > p, .dialog-kicker {
  display: flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .78rem;
  font-weight: 500; line-height: 1.35; letter-spacing: .075em; text-transform: uppercase;
}
.cover-content > p { color: #dafa9b; margin-bottom: 1.35rem; }
.cover-content > p .icon { width: 1.05rem; height: 1.05rem; }
.cover-content h2 { font-size: clamp(1.75rem, 2.55vw, 2.32rem); line-height: 1.06; letter-spacing: -.046em; font-weight: 570; }
.cover-content h2 em { font-size: 1.12em; letter-spacing: -.025em; }
.ticket-details { padding: 1.55rem 1.65rem 1.45rem; }
.cohort-facts, .success-facts { display: grid; gap: .85rem; margin: 0; }
.cohort-facts > div, .success-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.cohort-facts dt { display: inline-flex; align-items: center; gap: .5rem; }
.cohort-facts dt, .success-facts dt { color: var(--muted); }
.cohort-facts dt .icon { width: 1rem; height: 1rem; color: var(--green); align-self: center; }
.cohort-facts dd, .success-facts dd { margin: 0; text-align: right; font-weight: 645; }
.cohort-facts > div { font-size: .92rem; }
.cohort-capacity { margin-top: 1.4rem; padding: .85rem 1rem .95rem; border: 1px solid var(--soft-edge); border-radius: .65rem; background: var(--wash); }
.cohort-capacity p { font-size: .99rem; color: var(--green); line-height: 1.4; font-weight: 700; }
.chairs { display: grid; grid-template-columns: repeat(10, minmax(0,1fr)); align-items: center; column-gap: .2rem; margin-top: .45rem; color: var(--green); max-width: 18.2rem; }
.chairs .icon { width: min(100%, 1.5rem); height: auto; aspect-ratio: 1; stroke-width: 1.6; }
.chairs .icon:nth-child(n+6) { transform: translateX(.14rem); }
.ticket-total {
  position: relative; display: flex; align-items: center; justify-content: space-between; padding: 1.18rem 1.65rem 1.28rem;
  border-top: 1.5px dashed var(--ticket-edge);
}
.ticket-total::before, .ticket-total::after {
  content: ""; position: absolute; top: -.48rem; width: .48rem; height: .96rem;
  background: var(--paper); border: 1px solid var(--ticket-edge);
}
.ticket-total::before { left: -1px; border-left: 0; border-radius: 0 1rem 1rem 0; }
.ticket-total::after { right: -1px; border-right: 0; border-radius: 1rem 0 0 1rem; }
.ticket-total > div:first-child { display: grid; gap: .08rem; }
.ticket-total > div:first-child strong { font-size: 1.09rem; letter-spacing: -.027em; }
.ticket-total > div:first-child span { color: var(--muted); font-size: .86rem; }
.price { display: flex; align-items: baseline; gap: .44rem; }
.price strong { font-size: 2.6rem; line-height: 1; letter-spacing: -.075em; font-weight: 610; }
.price small, .mobile-total small { font: 500 .77rem/1.3 var(--mono); color: var(--muted); }
.mobile-ticket-line, .summary-toggle { display: none; }

.enroll-form { grid-area: form; min-width: 0; margin-top: 1.85rem; }
.details-section { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.form-heading { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin-bottom: 1rem; }
.form-heading h2 { font-size: 1.35rem; font-weight: 640; line-height: 1.2; letter-spacing: -.045em; }
.demo-fill { display: inline-flex; align-items: center; gap: .32rem; min-height: 2.15rem; font-size: .88rem; font-weight: 610; color: var(--green); }
.demo-fill .icon { width: 1rem; height: 1rem; }
.fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .87rem 1rem; }
.field { display: flex; flex-direction: column; align-items: stretch; gap: .32rem; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .92rem; font-weight: 640; }
.field label span { font-weight: 400; color: var(--muted); margin-left: .25rem; font-size: .83rem; }
.field input {
  width: 100%; min-width: 0; min-height: 2.95rem; padding: .68rem .85rem; font-size: 1rem; line-height: 1.35;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: .54rem;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--input-ink); opacity: 1; }
.field input:hover { border-color: var(--input-ink); }
.field input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.field input[aria-invalid=true], .refund-box:has([aria-invalid=true]) { border-color: var(--error); }
.field-error { color: var(--error); font-size: .87rem; line-height: 1.4; }
.payment-section { margin-top: 1.55rem; border-top: 1px solid var(--line); padding-top: 1.35rem; }
.refund-box {
  display: flex; align-items: flex-start; gap: .7rem; background: var(--wash);
  border: 1px solid var(--soft-edge); border-radius: .6rem; padding: .83rem .88rem;
  font-size: .94rem; line-height: 1.45; cursor: pointer;
}
.refund-box strong { font-weight: 650; }
.refund-box input { width: 1.12rem; height: 1.12rem; flex: none; margin: .12rem 0 0; accent-color: var(--action-bg); cursor: pointer; }
#refund-error { display: block; margin-top: .28rem; }
.payment-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .72rem; margin-top: 1rem; }
.pay-action {
  display: flex; justify-content: flex-start; align-items: center; gap: .8rem; min-height: 4.05rem;
  padding: .65rem 1.02rem; border: 1px solid var(--green); border-radius: .67rem;
  text-align: left; line-height: 1.2; transition: box-shadow .15s, transform .15s, background .15s;
}
.pay-action > .icon { width: 1.4rem; height: 1.4rem; }
.pay-action > span { display: grid; gap: .16rem; }
.pay-action b { font-size: 1rem; font-weight: 690; }
.pay-action small { font-size: .83rem; font-weight: 420; }
.gateway-action, .dialog-primary { background: var(--action-bg); border-color: var(--action-bg); color: var(--action-fg); }
.manual-action { color: var(--green); background: var(--surface); }
.pay-action:not(:disabled):hover, .dialog-primary:not(:disabled):hover { box-shadow: 0 3px 0 -1px var(--green); transform: translateY(-1px); }
.pay-action:disabled, .dialog-primary:disabled { cursor: default; opacity: .48; }
.preview-note, .modal-meta { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.preview-note { display: flex; align-items: center; gap: .38rem; margin: .77rem 0 0; }
.preview-note .icon { width: 1rem; height: 1rem; }
.availability-note { border-left: 3px solid var(--green); color: var(--ink); font-size: .94rem; margin-top: 1rem; padding: .25rem .7rem; }

#checkout-dialog {
  position: fixed; width: min(28rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto;
  margin: auto; padding: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--ticket-edge);
  border-radius: 1rem; box-shadow: 0 24px 95px rgba(0,0,0,.25);
}
#checkout-dialog::backdrop { background: rgba(10,25,21,.52); backdrop-filter: blur(3px); }
body:has(#checkout-dialog[open]) { overflow: hidden; }
.dialog-body { padding: 1.45rem 1.6rem 1.5rem; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .7rem; }
.dialog-kicker { color: var(--green); }
.dialog-close { width: 2.45rem; min-height: 2.45rem; }
.dialog-close .icon { width: 1rem; height: 1rem; }
#dialog-title { font-size: 2.4rem; line-height: 1.07; letter-spacing: -.045em; font-family: var(--serif); font-weight: 400; margin-bottom: .67rem; outline: 0; }
.dialog-intro { color: var(--muted); line-height: 1.5; margin-bottom: 1.1rem; }
.wallets { display: grid; gap: .55rem; padding: 0; margin: 1.05rem 0; border: 0; }
.wallets label {
  display: flex; align-items: center; gap: .68rem; min-height: 3rem; cursor: pointer;
  padding: .68rem .85rem; border: 1px solid var(--line); background: var(--surface); border-radius: .52rem;
}
.wallets label:has(input:checked) { border-color: var(--green); background: var(--wash); }
.wallets input { margin: 0; width: 1.1rem; height: 1.1rem; accent-color: var(--action-bg); }
.wallets label span { font-weight: 610; }
.wallets label small { display: block; font-weight: 400; color: var(--muted); font-size: .84rem; }
.modal-total { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding: .9rem 0; }
.dialog-primary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 2.9rem; padding: .65rem; border: 1px solid var(--action-bg); border-radius: .57rem; font-weight: 660; font-size: 1rem; }
.modal-meta { margin: .63rem 0 0; }
.message-preview { padding: 1rem; margin: .95rem 0 1.1rem; border: 1px solid var(--soft-edge); border-radius: .6rem; background: var(--wash); }
.message-preview > span { display: flex; align-items: center; gap: .45rem; color: var(--green); font-weight: 650; font-size: .94rem; margin-bottom: .45rem; }
.message-preview p { font-size: .95rem; line-height: 1.5; }
.success-symbol { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; margin: 1rem 0 .8rem; border-radius: 50%; color: var(--green); background: var(--mint); }
.success-facts { margin: 1rem 0 1.25rem; font-size: .95rem; }

@media (min-width: 801px) and (max-width: 1020px) {
  .checkout-wrap { width: calc(100% - 3.5rem); }
  .checkout-grid { column-gap: 2.25rem; grid-template-columns: minmax(0,1.27fr) minmax(0,1fr); }
  .ticket-details, .ticket-total { padding-inline: 1.15rem; }
  .cover-content { padding-inline: 1.2rem; }
  .field label span { margin-left: .08rem; }
  .pay-action { padding-inline: .65rem; gap: .48rem; }
}
@media (max-width: 800px) {
  .checkout-wrap { width: min(100% - 2.5rem, 39rem); }
  .checkout-grid { grid-template-columns: minmax(0,1fr); grid-template-areas: "intro" "receipt" "form"; padding-block: 1.8rem 2.5rem; }
  .checkout-nav { min-height: 4rem; }
  .checkout-nav .brand { width: 7.55rem; }
  .home-link { display: none; }
  .checkout-nav-actions { gap: .45rem; }
  .checkout-intro h1 { font-size: clamp(2.65rem, 8.25vw, 4.1rem); margin-top: .48rem; }
  .checkout-intro > p:last-child { font-size: 1rem; }
  .order-column { margin-top: 1.2rem; }
  .order-column::before { display: none; }
  .ticket-cover { min-height: 0; border-radius: .8rem .8rem 0 0; }
  .cohort-ticket { border-radius: .87rem; }
  .cover-content { padding: .92rem 1rem 1rem; }
  .cover-content > p { margin-bottom: .42rem; font-size: .74rem; }
  .cover-content > p .icon { width: .92rem; height: .92rem; }
  .cover-content h2 { font-size: 1.35rem; line-height: 1.15; }
  .cover-content h2 br { display: none; }
  .cover-content h2 em { display: inline; }
  .cover-content h2 em::before { content: " "; }
  .mobile-ticket-line { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .58rem 1rem 0; }
  .mobile-ticket-line > span:first-child { font-size: .93rem; font-weight: 640; color: var(--green); }
  .mobile-total { font-size: 1.2rem; font-weight: 700; letter-spacing: -.04em; }
  .mobile-total small { letter-spacing: 0; }
  .summary-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; min-height: 2.6rem; padding: .3rem 1rem .57rem; color: var(--muted); font-size: .89rem; font-weight: 560; }
  .summary-toggle .icon { width: 1rem; height: 1rem; }
  .summary-toggle[aria-expanded=true] .icon { transform: rotate(180deg); }
  .summary-toggle[aria-expanded=false] + .ticket-details { display: none; }
  .ticket-details { padding: .9rem 1rem 1rem; border-top: 1px dashed var(--ticket-edge); }
  .ticket-total { display: none; }
  .enroll-form { margin-top: 1.45rem; }
  .details-section { border-top: 0; padding-top: 0; }
}
@media (max-width: 540px) {
  .checkout-wrap { width: calc(100% - 2.25rem); }
  .checkout-intro .kicker { font-size: .75rem; }
  .checkout-nav .brand { width: 6.6rem; }
  .preview-tools { padding-inline: .68rem; min-height: 2.5rem; gap: .35rem; font-size: .85rem; }
  .checkout-nav .theme-switch { min-height: 2.5rem; width: 2.5rem; }
  .fields { grid-template-columns: 1fr; gap: .75rem; }
  .payment-section { margin-top: 1.25rem; }
  .payment-actions { grid-template-columns: 1fr; gap: .55rem; }
  .pay-action { min-height: 3.6rem; }
  .dialog-body { padding: 1.1rem 1.15rem 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .checkout-page *, .checkout-page *::before, .checkout-page *::after { scroll-behavior: auto; transition: none; }
}
