/* ==== Checkout 專屬樣式 ==== */
.checkout-main { padding: 80px 24px 80px; margin-top: 20px; }
.checkout-container { max-width: 1200px; margin: 0 auto; }

/* Progress */
.progress-bar-wrap { margin-bottom: 40px; }
.step-list {
  display: flex; align-items: center; gap: 8px;
  max-width: 720px; margin: 0 auto;
}
.step {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-mute);
  transition: color .3s;
}
.step.active, .step.done { color: var(--gold); }
.step-num {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-2); border: 2px solid var(--border);
  font-family: var(--font-mono); font-weight: 700; font-size: 16px;
  color: var(--text-mute);
  transition: all .3s;
}
.step.active .step-num {
  background: var(--gold); border-color: var(--gold); color: var(--bg-0);
  box-shadow: 0 0 20px var(--gold-glow);
}
.step.done .step-num {
  background: transparent; border-color: var(--gold); color: var(--gold);
}
.step.done .step-num::before { content: '✓'; }
.step.done .step-num-txt { display: none; }
.step-lbl { font-size: 12px; letter-spacing: 1px; font-weight: 500; }
.step-line { flex: 1; height: 2px; background: var(--border); border-radius: 1px; max-width: 100px; }
.step-line.done { background: var(--gold); }

@media (max-width: 640px) {
  .step-lbl { display: none; }
  .step-line { max-width: 40px; }
}

/* Grid */
.checkout-grid {
  display: grid; grid-template-columns: 1fr 340px; gap: 40px;
  align-items: start;
}
@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr; }
}

.checkout-content {
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  min-height: 500px;
}
@media (max-width: 600px) { .checkout-content { padding: 24px 20px; } }

.checkout-content h2 {
  font-family: var(--font-display); font-size: 32px; font-weight: 900;
  margin-bottom: 8px;
}
.checkout-content .lead {
  color: var(--text-dim); margin-bottom: 20px;
}

.registration-flow-note {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(71, 205, 145, .38);
  border-left: 4px solid #47cd91;
  border-radius: 8px;
  background: rgba(71, 205, 145, .08);
  color: var(--text-dim);
  line-height: 1.7;
}

.registration-flow-note strong {
  display: block;
  color: #72e7ac;
  font-size: 16px;
  margin-bottom: 5px;
}

.registration-flow-note p { margin: 0; font-size: 14px; }

.early-bank-info {
  margin: 0 0 22px;
  padding: 18px 20px;
  border: 1px solid rgba(0, 224, 255, .35);
  border-left: 4px solid var(--neon-blue);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 224, 255, .09), rgba(245, 194, 77, .06));
  color: var(--text-dim);
  line-height: 1.65;
}

.early-bank-kicker {
  color: var(--neon-blue);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.early-bank-info h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
}

.early-bank-account {
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.early-bank-name {
  margin-top: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.early-bank-notes {
  margin-top: 7px;
  color: var(--text-mute);
  font-size: 13px;
}

.early-bank-amount {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  color: var(--text-dim);
  font-size: 13px;
}

@media (max-width: 600px) {
  .registration-flow-note { padding: 13px 14px; font-size: 14px; }
  .registration-flow-note strong { font-size: 15px; }
  .early-bank-info { padding: 15px 14px; }
  .early-bank-account { font-size: 15px; line-height: 1.5; }
  .early-bank-name, .early-bank-notes, .early-bank-amount { font-size: 13px; }
}

.step-panel { display: none; }
.step-panel.active { display: block; animation: fadein .3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Store cards in checkout — with radio */
.checkout-content .stores-toolbar { margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ck-filter-summary {
  margin-left: auto;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .5px;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .ck-filter-summary { width: 100%; margin-left: 0; padding-top: 2px; }
}
.checkout-content .stores-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.checkout-availability-state {
  grid-column: 1 / -1;
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-dim);
  text-align: center;
  line-height: 1.7;
}
.checkout-availability-state.is-error { color: #ffb0b0; border-color: rgba(255, 112, 112, .45); }
.checkout-content .store-card { cursor: pointer; padding: 16px; }
.checkout-content .store-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 20px var(--gold-glow);
  background: rgba(245,194,77,.08);
}
.checkout-content .store-card .buy { display: none; }
.checkout-content .store-card h4 { font-size: 15px; }
.checkout-content .store-card .addr { display: none; }

/* Step 2 summary */
.selected-summary {
  padding: 24px;
  background: linear-gradient(135deg, rgba(245,194,77,.08), transparent);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}
.selected-summary h4 {
  font-family: var(--font-display); font-size: 22px; margin-bottom: 4px;
}
.selected-summary .ss-addr { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; }
.selected-summary .ss-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  padding-top: 20px; border-top: 1px solid var(--border);
}
.selected-summary .ss-k { color: var(--text-mute); font-size: 11px; letter-spacing: 2px; margin-bottom: 4px; text-transform: uppercase; }
.selected-summary .ss-v { color: var(--text); font-family: var(--font-mono); font-weight: 600; font-size: 15px; }
.selected-summary .ss-v.gold { color: var(--gold); }

/* Addon */
.addon-box h4 { font-size: 16px; margin-bottom: 16px; color: var(--text-dim); }
.addon {
  display: flex; gap: 16px; padding: 16px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px;
  cursor: pointer; transition: all .2s;
}
.addon:has(input:checked) {
  border-color: var(--gold); background: rgba(245,194,77,.05);
}
.addon input {
  appearance: none;
  width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0;
  border: 2px solid var(--border-strong); border-radius: 3px;
  background: transparent; cursor: pointer;
  transition: all .15s;
}
.addon input:checked {
  background: var(--gold); border-color: var(--gold);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='none' stroke='%2305060f' stroke-width='2.5' stroke-linecap='round' d='M2 6l3 3 5-6'/></svg>");
  background-repeat: no-repeat; background-position: center;
}
.addon-title { font-weight: 600; margin-bottom: 4px; display: flex; justify-content: space-between; gap: 12px; }
.addon-title .addon-p { color: var(--gold); font-family: var(--font-mono); font-weight: 700; }
.addon-desc { font-size: 13px; color: var(--text-mute); }

/* Form */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 13px; color: var(--text-dim); font-weight: 500;
}
.field .req { color: var(--neon-pink); }
.field input, .field select {
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); font-family: var(--font-body); font-size: 15px;
  transition: all .15s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,194,77,.15);
}
.field input::placeholder { color: var(--text-mute); }
.field .hint { font-size: 12px; color: var(--text-mute); }
.check-lbl {
  display: flex; align-items: center; gap: 10px;
  font-weight: 500; color: var(--text-dim); font-size: 14px; cursor: pointer;
}
.check-lbl input {
  width: 18px; height: 18px; appearance: none;
  border: 2px solid var(--border-strong); border-radius: 3px;
  background: transparent; cursor: pointer;
}
.check-lbl input:checked {
  background: var(--gold);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='none' stroke='%2305060f' stroke-width='2.5' stroke-linecap='round' d='M2 6l3 3 5-6'/></svg>");
  background-repeat: no-repeat; background-position: center;
}

@media (max-width: 500px) { .form-grid { grid-template-columns: 1fr; } }

/* Pay methods */
.pay-methods {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 32px;
}
@media (max-width: 500px) { .pay-methods { grid-template-columns: 1fr; } }
.pay-method {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; transition: all .15s;
  position: relative;
}
.pay-method.active {
  border-color: var(--gold);
  background: rgba(245,194,77,.05);
  box-shadow: 0 0 20px var(--gold-glow);
}
.pay-method input {
  position: absolute; top: 8px; right: 8px;
  appearance: none;
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong); border-radius: 50%;
}
.pay-method input:checked {
  border-color: var(--gold);
  background: radial-gradient(circle, var(--gold) 40%, transparent 45%);
}
.pm-name { font-weight: 600; font-size: 15px; }
.pm-icons { display: flex; gap: 6px; }
.pm-icons span {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  padding: 3px 6px; background: rgba(255,255,255,.05);
  border: 1px solid var(--border); border-radius: 2px;
  color: var(--text-dim);
}

/* Credit card visual */
.cc-card { margin-bottom: 24px; }
.cc-visual {
  padding: 28px;
  background:
    linear-gradient(135deg, #131a34 0%, #1a2447 40%, #0a0d1e 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  position: relative; overflow: hidden;
  aspect-ratio: 1.6;
  max-width: 420px;
  color: white;
}
.cc-visual::before {
  content: ''; position: absolute; top: -20%; right: -20%;
  width: 60%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(245,194,77,.3), transparent 60%);
  filter: blur(20px);
}
.cc-visual::after {
  content: ''; position: absolute; bottom: -30%; left: -10%;
  width: 60%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(0,224,255,.2), transparent 60%);
  filter: blur(20px);
}
.cc-chip {
  width: 40px; height: 30px; border-radius: 4px;
  background: linear-gradient(135deg, #f5c24d, #b8871f);
  position: relative; z-index: 1;
}
.cc-brand {
  position: absolute; top: 24px; right: 28px;
  font-family: var(--font-mono); font-weight: 900; font-size: 22px;
  letter-spacing: 2px;
  color: var(--gold);
  z-index: 1;
}
.cc-num {
  position: absolute; left: 28px; bottom: 70px;
  font-family: var(--font-mono); font-size: 22px; letter-spacing: 3px;
  color: white; font-weight: 500;
  z-index: 1;
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.cc-row {
  position: absolute; left: 28px; right: 28px; bottom: 20px;
  display: flex; justify-content: space-between;
  z-index: 1;
}
.cc-k { font-size: 9px; color: rgba(255,255,255,.6); letter-spacing: 2px; margin-bottom: 3px; }
.cc-v { font-family: var(--font-mono); font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }

@media (max-width: 500px) {
  .cc-visual { padding: 20px; }
  .cc-num { font-size: 17px; bottom: 60px; left: 20px; }
  .cc-row { left: 20px; right: 20px; }
}

/* Step nav */
.step-nav {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 40px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.step-nav .btn-ghost { padding: 14px 24px; }
.step-nav .btn-primary { padding: 14px 32px; }
.step-nav .btn-ghost.hidden { visibility: hidden; }

/* Sidebar summary */
.checkout-sidebar { position: static; }
@media (max-width: 900px) { .checkout-sidebar { position: static; } }

.summary-card {
  padding: 32px 28px;
  background: var(--panel-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 30px rgba(245,194,77,.08);
}
.summary-card h3 {
  font-family: var(--font-display); font-size: 22px; font-weight: 900;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.sm-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 0;
}
.sm-name { font-weight: 600; font-size: 15px; }
.sm-sub { font-size: 12px; color: var(--text-mute); margin-top: 4px; font-family: var(--font-mono); }
.sm-price { font-family: var(--font-mono); font-weight: 700; color: var(--text); white-space: nowrap; }
.sm-divider { height: 1px; background: var(--border); margin: 16px 0; }
.sm-total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0 16px;
}
.sm-total-row > span:first-child {
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
}
.sm-total {
  font-family: var(--font-mono); font-weight: 700; font-size: 32px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sm-hint {
  font-size: 12px; color: var(--text-dim); line-height: 1.7;
  padding-top: 16px; border-top: 1px solid var(--border);
}

/* ============ Success ============ */
.success-panel {
  max-width: 640px; margin: 60px auto;
  padding: 0 24px;
}
.success-card {
  padding: 48px 40px;
  background: var(--panel-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 0 60px rgba(245,194,77,.15);
}
.success-icon {
  width: 80px; height: 80px; margin: 0 auto 20px;
  color: var(--neon-green);
  animation: pop .5s ease;
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.success-eyebrow {
  font-family: var(--font-mono); color: var(--neon-blue);
  font-size: 12px; letter-spacing: 3px; margin-bottom: 12px;
}
.success-card h2 {
  font-family: var(--font-display); font-size: 40px; font-weight: 900;
  margin-bottom: 12px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.success-card p { color: var(--text-dim); margin-bottom: 32px; }
.success-private-note {
  padding: 12px 14px;
  border: 1px solid rgba(41, 214, 255, .32);
  border-radius: var(--radius);
  background: rgba(41, 214, 255, .06);
  color: var(--text-soft) !important;
  font-size: 13px;
  line-height: 1.75;
  text-align: left;
}
.success-private-note strong { color: var(--neon-blue); }

.success-ticket {
  background: linear-gradient(135deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
  position: relative;
}
.success-ticket::before, .success-ticket::after {
  content: ''; position: absolute; width: 20px; height: 20px;
  background: var(--bg-0); border-radius: 50%;
  left: 0; right: auto;
  top: 50%; transform: translateY(-50%);
}
.success-ticket::before { left: -10px; }
.success-ticket::after { left: auto; right: -10px; }
.st-header {
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 20px 24px;
  background: linear-gradient(90deg, rgba(245,194,77,.1), transparent);
  border-bottom: 1px dashed var(--border);
}
.st-body { padding: 24px; }
.st-cols {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.st-k {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-mute); letter-spacing: 2px; margin-bottom: 4px;
  text-transform: uppercase;
}
.st-v { font-weight: 700; font-size: 15px; }
.st-qr { padding: 20px 24px; border-top: 1px dashed var(--border); background: rgba(0,0,0,.2); }
.qr-placeholder {
  width: 120px; height: 120px; margin: 0 auto; padding: 10px;
  background: white; border-radius: 6px;
}


/* Non-blocking validation feedback */
.checkout-inline-error {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 82, 125, .6);
  border-radius: var(--radius);
  background: rgba(255, 82, 125, .1);
  color: #ffb2c5;
  font-size: 14px;
  line-height: 1.6;
}
.checkout-inline-error::before {
  content: '⚠ ';
  color: #ff527d;
  font-weight: 700;
}
.checkout-inline-error[hidden] { display: none; }
.field input[aria-invalid="true"] {
  border-color: #ff527d;
  box-shadow: 0 0 0 3px rgba(255, 82, 125, .14);
}
@media (max-width: 600px) {
  .checkout-inline-error { font-size: 13px; padding: 10px 12px; }
}

/* P.1 場次確認摘要 */
#ck-store-summary { min-height: 180px; }
#ck-store-summary h3 { margin-top: 0; }
.summary-table { display: grid; gap: 12px; margin-top: 20px; }
.summary-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding: 18px 20px; border: 1px solid var(--border-light); border-radius: 10px; background: rgba(255,255,255,0.025); }
.summary-row > div:first-child { font-weight: 700; color: var(--text-strong); }
.summary-row > div:nth-child(2) { color: var(--text-dim); white-space: nowrap; }
.summary-row > div:last-child { color: var(--gold); font-weight: 700; white-space: nowrap; }

/* P.2 頁內規則與個資同意 */
body.consent-modal-open { overflow: hidden; }
.consent-required-row { align-items: flex-start; }
.consent-required-row input:disabled { opacity: 0.55; cursor: not-allowed; }
.consent-link { appearance: none; border: 0; padding: 0; background: transparent; color: var(--gold); font: inherit; text-decoration: underline; cursor: pointer; }
.consent-link:hover, .consent-link:focus-visible { color: #fff1a6; }
.consent-modal[hidden] { display: none; }
.consent-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; }
.consent-modal-backdrop { position: absolute; inset: 0; background: rgba(2,5,18,0.84); backdrop-filter: blur(4px); }
.consent-modal-card { position: relative; z-index: 1; width: min(760px, 100%); max-height: min(760px, calc(100vh - 40px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,215,0,0.4); border-radius: 14px; background: #101735; box-shadow: 0 24px 80px rgba(0,0,0,0.55); }
.consent-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border-light); }
.consent-modal-header h2 { margin: 0; color: var(--text-strong); font-size: clamp(20px, 3vw, 28px); }
.consent-modal-x { border: 0; background: transparent; color: var(--text-dim); font-size: 32px; line-height: 1; cursor: pointer; }
.consent-modal-x:hover, .consent-modal-x:focus-visible { color: var(--gold); }
.consent-scroll { min-height: 0; overflow-y: auto; padding: 24px; color: var(--text-dim); line-height: 1.85; outline: none; }
.consent-scroll:focus-visible { box-shadow: inset 0 0 0 2px rgba(255,215,0,0.5); }
.consent-scroll h3 { margin: 0 0 10px; color: var(--gold); font-size: 18px; }
.consent-scroll p { margin: 0 0 18px; }
.consent-modal-footer { display: grid; gap: 12px; padding: 16px 24px 20px; border-top: 1px solid var(--border-light); background: rgba(0,0,0,0.16); }
.consent-scroll-hint { color: var(--gold); font-size: 13px; }
.consent-modal-check { display: flex; align-items: flex-start; gap: 10px; color: var(--text-strong); font-size: 14px; }
.consent-modal-check input { margin-top: 4px; accent-color: var(--gold); }
.consent-modal-footer .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 768px) {
  .summary-row { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px; }
  .summary-row > div:nth-child(2) { grid-column: 1; }
  .summary-row > div:last-child { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .consent-modal { padding: 10px; }
  .consent-modal-card { max-height: calc(100vh - 20px); border-radius: 12px; }
  .consent-modal-header, .consent-modal-footer { padding-left: 16px; padding-right: 16px; }
  .consent-scroll { padding: 18px 16px; font-size: 14px; }
}

/* 結帳完成狀態：成功卡片取代付款內容，避免左側空白與右側重複操作 */
.progress-bar-wrap.checkout-complete-hidden { display: none; }
.checkout-grid.checkout-complete { display: block; }
.checkout-grid.checkout-complete .checkout-sidebar { display: none; }
.checkout-grid.checkout-complete .checkout-content {
  max-width: 860px;
  margin: 0 auto;
  min-height: 0;
}
.checkout-content > .success-panel {
  max-width: none;
  margin: 0;
  padding: 0;
}
.checkout-content > .success-panel .success-card { margin: 0; }
.success-ticket .st-v { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .checkout-grid.checkout-complete .checkout-content { padding: 20px 16px; }
  .checkout-content > .success-panel .success-card { padding: 32px 20px; }
  .success-card h2 { font-size: 30px; }
  .st-cols { grid-template-columns: 1fr; gap: 14px; }
  .st-header { gap: 12px; padding: 16px; }
  .st-body { padding: 18px; }
}
