/* Checkout — ticket checkout dialog and responsive scroll treatment. Keep this file linked in source order. */

/* Checkout modal — Plots-style multi-step RSVP ───────────────────── */

.checkout-modal {
  width: min(480px, calc(100vw - 24px));
  max-width: none;
  padding: 0;
  margin: auto;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 22px;
  background: #0d111b;
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.checkout-modal::backdrop {
  background: rgba(5, 8, 14, 0.72);
  backdrop-filter: blur(4px);
}

body.light-mode .checkout-modal {
  background: #fbfcff;
  border-color: rgba(18, 41, 62, 0.10);
}

.checkout-modal[open] {
  animation: checkout-pop 0.22s ease;
}

@keyframes checkout-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.checkout-form {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px 22px 22px;
  gap: 14px;
  min-height: 480px;
}

/* These wrappers preserve the desktop flow while allowing short mobile
   viewports to keep checkout actions visible outside a scrollable step area. */
.checkout-scroll,
.checkout-actions {
  display: contents;
}

.checkout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
}

.checkout-back,
.checkout-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.18s ease, border-color 0.18s ease;
}

body.light-mode .checkout-back,
body.light-mode .checkout-close {
  border-color: rgba(18, 41, 62, 0.10);
  background: rgba(18, 41, 62, 0.04);
}

.checkout-back svg { width: 18px; height: 18px; }

.checkout-back:hover,
.checkout-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.checkout-back[hidden] { visibility: hidden; }

.checkout-skip {
  margin-left: auto;
  margin-right: 6px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 6px 4px;
}

.checkout-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

body.light-mode .checkout-progress {
  background: rgba(18, 41, 62, 0.08);
}

.checkout-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.28s ease;
}

.checkout-tier-strip {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.light-mode .checkout-tier-strip {
  background: rgba(18, 41, 62, 0.04);
  border-color: rgba(18, 41, 62, 0.08);
}

.checkout-tier-strip-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.checkout-tier-strip-price {
  margin-left: auto;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.checkout-step {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 0 4px;
  flex: 1 1 auto;
}

.checkout-step[hidden] { display: none; }

.checkout-question {
  font-family: var(--font-display);
  font-size: 2.05rem;
  line-height: 1.05;
  font-weight: 800;
  margin: 4px 0 0;
  letter-spacing: 0;
}

.checkout-sub {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted-2);
}

.checkout-hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted-2);
}

.checkout-field {
  display: block;
}

.checkout-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body.light-mode .checkout-input {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(18, 41, 62, 0.12);
}

.checkout-input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

body.light-mode .checkout-input::placeholder {
  color: rgba(18, 41, 62, 0.36);
}

.checkout-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

.checkout-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkout-field-with-prefix {
  display: flex;
  align-items: stretch;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

body.light-mode .checkout-field-with-prefix {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(18, 41, 62, 0.12);
}

.checkout-field-with-prefix:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

.checkout-field-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--muted-2);
}

.checkout-field-with-prefix .checkout-input {
  border: none;
  background: transparent;
  border-radius: 0;
  flex: 1 1 auto;
}

.checkout-field-with-prefix .checkout-input:focus {
  box-shadow: none;
  border: none;
}

.checkout-ig-glyph {
  width: 22px;
  height: 22px;
}

.checkout-photo-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 0 0;
  cursor: pointer;
}

.checkout-photo-preview {
  width: 200px;
  height: 200px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  overflow: hidden;
  transition: border-color 0.18s ease;
}

body.light-mode .checkout-photo-preview {
  background: rgba(18, 41, 62, 0.04);
  border-color: rgba(18, 41, 62, 0.18);
  color: rgba(18, 41, 62, 0.5);
}

.checkout-photo-preview.has-image {
  border-style: solid;
  border-color: var(--accent);
}

.checkout-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkout-photo-sketch {
  width: 70%;
  height: 70%;
}

.checkout-photo-action {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.checkout-photo-status {
  font-size: 0.85rem;
  color: var(--muted-2);
}

.checkout-privacy-controls {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.checkout-consent-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.38;
  cursor: pointer;
}

.checkout-consent-option input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.checkout-wall-consent {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.checkout-retention-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
  font-size: 0.84rem;
  font-weight: 800;
}

.checkout-retention-field select {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.26);
  color: var(--text);
  font: inherit;
  padding: 0 9px;
}

body.light-mode .checkout-privacy-controls {
  border-color: rgba(18, 41, 62, 0.12);
  background: rgba(18, 41, 62, 0.035);
}

body.light-mode .checkout-wall-consent {
  border-color: rgba(18, 41, 62, 0.10);
}

body.light-mode .checkout-retention-field select {
  border-color: rgba(18, 41, 62, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

/* The default [hidden] { display: none } is overridden by the display:flex
   rules on these blocks; restore the expected behavior. */
.checkout-photo-zone[hidden],
.checkout-photo-prev[hidden] {
  display: none !important;
}

/* Repeat-customer banner */

.checkout-photo-prev {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

body.light-mode .checkout-photo-prev {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

.checkout-photo-prev-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.checkout-photo-prev-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
}

.checkout-photo-prev-meta strong {
  font-size: 0.95rem;
}

.checkout-photo-prev-meta span {
  color: var(--muted-2);
}

.checkout-photo-prev-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.checkout-photo-prev-actions button {
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}

body.light-mode .checkout-photo-prev-actions button {
  border-color: rgba(0, 0, 0, 0.15);
}

.checkout-photo-prev-use {
  background: var(--accent) !important;
  color: var(--accent-on) !important;
  border-color: transparent !important;
}

.checkout-continue {
  width: 100%;
  margin-top: auto;
  padding: 16px 18px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.05s ease;
  font-family: inherit;
}

.checkout-continue:hover {
  opacity: 0.92;
}

.checkout-continue:active {
  transform: translateY(1px);
}

.checkout-continue:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.55);
}

body.light-mode .checkout-continue:disabled {
  background: rgba(18, 41, 62, 0.08);
  color: rgba(18, 41, 62, 0.45);
}

.checkout-step-success {
  align-items: center;
  text-align: center;
  padding-top: 24px;
}

.checkout-success-mark {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-on);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  margin: 0 auto 4px;
}

.checkout-error {
  font-size: 0.9rem;
  color: #ffb4b4;
  background: rgba(255, 99, 99, 0.12);
  border: 1px solid rgba(255, 99, 99, 0.28);
  border-radius: 10px;
  padding: 8px 12px;
}

.checkout-card-mount {
  min-height: 200px;
  padding: 4px 0;
}

.checkout-card-mount iframe {
  border-radius: 10px !important;
}

.checkout-card-loading {
  padding: 36px 14px;
  text-align: center;
  color: var(--muted-2);
  font-size: 0.92rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

body.light-mode .checkout-card-loading {
  background: rgba(18, 41, 62, 0.04);
}

/* Tier cards now act as buttons — strip browser defaults so they look the
   same as the original divs. */
button.event-tier {
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
}

@media (max-width: 480px) {
  .checkout-modal {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .checkout-form {
    height: 100%;
    min-height: 0;
    padding: 14px 18px max(18px, env(safe-area-inset-bottom, 0px));
    gap: 0;
  }
  .checkout-scroll {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    gap: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 2px 12px 0;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
  }
  .checkout-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    flex: 0 0 auto;
    gap: 10px;
    padding: 12px 0 0;
    background: linear-gradient(180deg, rgba(13, 17, 27, 0), #0d111b 28%);
  }
  .checkout-actions:has(.checkout-continue[hidden]):has(.checkout-error[hidden]) {
    display: none;
  }
  .checkout-actions .checkout-continue {
    margin-top: 0;
  }
  body.light-mode .checkout-actions {
    background: linear-gradient(180deg, rgba(251, 252, 255, 0), #fbfcff 28%);
  }
  .checkout-question {
    font-size: 1.85rem;
  }
}

