/* Dark branded checkout shell — a navy page with a soft cyan/teal radial wash,
   mirroring the builder (.bido-builder-page). The dense payment + participant
   forms live on a light island (.bido-checkout-work) so fields stay readable;
   the summary side rail reads the dark tokens for the branded total. */
.bido-checkout-page {
  background-color: var(--bx-paper);
  background-image:
    radial-gradient(ellipse 60% 50% at 12% 6%, rgba(var(--bx-accent-rgb), 0.10), transparent 60%),
    radial-gradient(ellipse 50% 40% at 92% 24%, rgba(var(--bx-teal-rgb), 0.08), transparent 60%);
}

/* Light work island — the payment/participant workspace floating on the dark
   backdrop, the sibling of the builder's .bido-builder-picker. Carries
   .bx-light-surface in the markup so its cards/inputs/tables read light tokens.
   It must re-declare `color` (not just the --bx-* vars): the page root .bx set
   `color: var(--bx-ink)` against the dark ink and that *computed* near-white
   value inherits in. Without this, bare text (choice-card titles, .num amounts,
   table names) would render near-white on the light surface. */
.bido-checkout-work {
  background: var(--bx-paper);
  color: var(--bx-ink);
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-r-xl);
  padding: 24px;
  box-shadow: 0 30px 60px -42px rgba(var(--bx-navy-rgb), 0.55);
}

/* Payment-mode cards reflow 3→2→1 on container width (Rule 7). */
.bido-payment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.bido-payment-grid form {
  display: flex;
}

.bido-payment-save {
  display: flex;
  justify-content: flex-end;
  margin-block: 6px 22px;
}

.bido-choice-card {
  width: 100%;
  text-align: left;
}

.bido-choice-card .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bido-choice-card strong {
  display: block;
  margin-top: 8px;
  font-size: var(--bx-text);
}

.bido-choice-card p {
  margin-top: 4px;
  font-size: var(--bx-text-sm);
}

/* Consequence preview shown under each payment-mode description so the
   organizer sees the concrete outcome before clicking the radio. */
.bido-payment-consequence {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  padding-block-start: 8px;
  border-block-start: 1px dashed var(--bx-line);
  color: var(--bx-ink-2);
  font-size: var(--bx-text-xs);
  font-weight: 600;
}

.bido-payment-consequence svg {
  flex: 0 0 auto;
  margin-block-start: 2px;
}

.bido-payment-note {
  padding: 18px;
  margin-bottom: 22px;
}

.bido-payment-note .inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.bido-group-status-note {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--bx-accent-line);
  border-radius: var(--bx-r);
  background: var(--bx-accent-soft);
}

.bido-payment-note strong {
  font-size: var(--bx-text);
}

.bido-payment-note p {
  margin-top: 4px;
  font-size: var(--bx-text-sm);
}

.bido-card-form {
  padding: 18px;
}

.bido-wallet-row {
  flex-wrap: wrap;
  margin-top: 12px;
}

.bido-checkout-cta { margin-top: 14px; }
.bx .button_to:has(.bido-checkout-cta),
.bx .button_to:has(.bido-full-width-action) {
  display: flex;
  width: 100%;
}
.bido-terms-copy { margin-top: 14px; font-size: var(--bx-text-xs); }
.bido-terms-copy a { color: var(--bx-ink); }
.bido-checkout-pay-heading { margin-bottom: 8px; }
.bido-payment-amount-row { margin-bottom: 12px; }
.bido-checkout-help { margin-top: 6px; }

.bido-checkout-participants-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.bido-participants-meta {
  margin-top: 4px;
}

.bido-participant-table td:last-child {
  min-width: 280px;
}

.bido-participant-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.bido-participant-edit-form {
  display: grid;
  grid-template-columns: minmax(96px, .8fr) minmax(150px, 1.1fr) auto;
  align-items: center;
  gap: 6px;
}

.bido-participant-edit-form .input {
  min-height: var(--bx-control-h-sm);
  padding: 6px 8px;
  font-size: var(--bx-text-sm);
}

.bido-checkout-afterpay {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--bx-accent-line);
  border-radius: var(--bx-r);
  background: var(--bx-accent-soft);
}

.bido-checkout-afterpay p {
  margin: 0;
  font-size: var(--bx-text-sm);
}

/* === Responsive — checkout ===
   On narrow viewports the participant controls stack and the inline edit
   form drops to a single column. The participant table itself reflows from
   a 6-column grid into one card per row — each cell becomes a labeled line
   driven by the data-label attribute set in the ERB. */
@media (max-width: 48rem) {
  .bido-checkout-work {
    padding: 18px;
  }
  .bido-checkout-participants-head,
  .bido-participant-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .bido-payment-note .inner {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  /* 2-up grid for name + email so a participant edit row is three rows
     instead of four (name+email, save, sibling Remove). The submit spans
     the full row by jumping to `grid-column: 1 / -1`. */
  .bido-participant-edit-form {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .bido-participant-edit-form input[type="submit"] {
    grid-column: 1 / -1;
  }
  /* The reflowed table renders as stacked cards, so drop the 640px min-width
     it carries for the desktop scroll layout (.bido-table-card .tbl) — below
     48rem the shared reset doesn't fire, and that min-width would otherwise
     stretch the single-column content grid wider than the phone viewport. */
  .bido-participant-table { display: block; }
  /* Scoped under .bido-table-card to match the specificity of the shared
     `.bido-table-card .tbl { min-width: 640px }` rule and win on source order;
     a bare `.bido-participant-table` selector loses to it and the overflow
     persists. */
  .bido-table-card .bido-participant-table { min-width: 0; }
  .bido-participant-table td:last-child { min-width: 0; }
  .bido-participant-table thead { display: none; }
  .bido-participant-table tbody,
  .bido-participant-table tr,
  .bido-participant-table td { display: block; }
  .bido-participant-table tbody {
    display: grid;
    gap: 10px;
  }
  .bido-participant-table tr {
    padding: 12px 14px;
    border: 1px solid var(--bx-line);
    border-radius: var(--bx-r);
    background: var(--bx-paper);
  }
  .bx-dark .bido-participant-table tr {
    background: var(--bx-paper-2);
  }
  .bido-participant-table td {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 4px 0;
    border: 0;
  }
  .bido-participant-table td[data-label]::before {
    content: attr(data-label);
    font-size: var(--bx-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bx-ink-3);
    font-weight: 700;
  }
  .bido-participant-table td[data-label="Traveler"] {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding-block-end: 8px;
    border-block-end: 1px solid var(--bx-line);
    margin-block-end: 4px;
  }
  .bido-participant-table td[data-label="Traveler"]::before {
    display: none;
  }
  .bido-participant-table td[data-label="Actions"] {
    flex-direction: column;
    align-items: stretch;
    padding-block-start: 8px;
    border-block-start: 1px solid var(--bx-line);
    margin-block-start: 4px;
  }
  .bido-participant-table td[data-label="Actions"]::before {
    align-self: flex-start;
  }
  .bido-participant-table .bido-participant-actions {
    width: 100%;
  }
  .bido-payment-consequence {
    margin-top: 6px;
  }
}

