.checkout-modal {
  --checkout-ink: #181d26;
  --checkout-muted: #657080;
  --checkout-line: #dce2e8;
  --checkout-surface: #ffffff;
  --checkout-soft: #f5f7f8;
  --checkout-accent: var(--brand-color-default, #00a68f);
  --checkout-accent-light: var(--brand-color-light, #e6f9f9);
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--checkout-ink);
  font-family: var(--font-family-alt, 'NeueMontreal', Arial, sans-serif);
}

.checkout-modal.is-open { display: flex; }
.checkout-modal__backdrop { position: absolute; inset: 0; background: rgba(9, 16, 27, .72); backdrop-filter: blur(6px); }
.checkout-modal__dialog { position: relative; width: min(920px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--checkout-surface); border-radius: 24px; box-shadow: 0 28px 90px rgba(0, 0, 0, .35); }
.checkout-modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 28px 32px 24px; border-bottom: 1px solid var(--checkout-line); }
.checkout-modal__eyebrow { margin: 0 0 7px; color: var(--checkout-accent); font-family: var(--font-family-base, 'Inter', sans-serif); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.checkout-modal__title { margin: 0; font-family: var(--font-family-base, 'Inter', sans-serif); font-size: clamp(24px, 3vw, 34px); font-weight: 700; line-height: 1.1; }
.checkout-modal__subtitle { margin: 8px 0 0; color: var(--checkout-muted); font-size: 14px; line-height: 1.5; }
.checkout-modal__tax-notice { margin: 12px 0 0; padding: 10px 14px; border-radius: 8px; background: #fff3e0; border: 1px solid #ffe0b2; color: #bf5900; font-size: 14px; font-weight: 600; line-height: 1.45; }
.checkout-modal__close { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--checkout-accent-light); color: var(--checkout-accent); cursor: pointer; font-size: 26px; line-height: 1; }
.checkout-modal__close:hover { background: var(--checkout-accent); color: #fff; }
.checkout-modal__body { display: grid; grid-template-columns: 1.1fr .9fr; }
.checkout-modal__section { padding: 30px 32px 32px; }
.checkout-modal__section + .checkout-modal__section { border-left: 1px solid var(--checkout-line); background: var(--checkout-soft); }
.checkout-modal__section-title { margin: 0 0 20px; font-family: var(--font-family-base, 'Inter', sans-serif); font-size: 18px; font-weight: 700; }
.checkout-modal__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkout-modal__field { display: flex; flex-direction: column; gap: 7px; }
.checkout-modal__field--wide { grid-column: 1 / -1; }
.checkout-modal__label { color: #3f4854; font-size: 13px; font-weight: 700; }
.checkout-modal__input, .checkout-modal__select { width: 100%; height: 48px; box-sizing: border-box; border: 1px solid #cbd3dc; border-radius: 10px; background: #fff; padding: 0 14px; color: var(--checkout-ink); font: inherit; font-size: 15px; outline: none; }
.checkout-modal__input:focus, .checkout-modal__select:focus { border-color: var(--checkout-accent); box-shadow: 0 0 0 3px rgba(0, 166, 143, .14); }
.checkout-modal__input.is-invalid { border-color: #b83232; box-shadow: 0 0 0 3px rgba(184, 50, 50, .1); }
.checkout-modal__secure-box { border: 1px solid var(--checkout-line); border-radius: 14px; overflow: hidden; background: #fff; }
.checkout-modal__secure-top { display: flex; align-items: center; gap: 9px; padding: 13px 14px; border-bottom: 1px solid var(--checkout-line); color: #2e3946; font-size: 13px; font-weight: 700; }
.checkout-modal__lock { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--checkout-accent-light); color: var(--checkout-accent); }
.checkout-modal__lock svg { width: 12px; height: 12px; }
.checkout-modal__provider { padding: 20px 16px; }
.checkout-modal__card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkout-modal__bin-status { margin: 12px 0 0; color: var(--checkout-muted); font-size: 12px; line-height: 1.45; }
.checkout-modal__bin-status.is-success { color: #087b69; }
.checkout-modal__bin-status.is-error { color: #a52727; }
.checkout-modal__provider-title { margin: 0 0 7px; font-size: 15px; font-weight: 700; }
.checkout-modal__provider-copy { margin: 0; color: var(--checkout-muted); font-size: 13px; line-height: 1.55; }
.checkout-modal__card-preview { margin-top: 16px; padding: 15px; border: 1px dashed #aeb8c3; border-radius: 10px; color: #7a8591; font-size: 13px; line-height: 1.6; }
.checkout-modal__summary { margin: 22px 0; padding: 16px 0; border-top: 1px solid var(--checkout-line); border-bottom: 1px solid var(--checkout-line); }
.checkout-modal__summary-row { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.checkout-modal__summary-row + .checkout-modal__summary-row { margin-top: 10px; }
.checkout-modal__summary strong { text-align: right; overflow-wrap: anywhere; }
.checkout-modal__pay { width: 100%; min-height: 44px; border: 0; border-radius: 12px; padding: 12px 18px; background: var(--checkout-accent); color: #fff; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; }
.checkout-modal__pay:hover { filter: brightness(.96); }
.checkout-modal__pay:disabled { cursor: wait; opacity: .65; }
.checkout-modal__notice { min-height: 38px; margin: 12px 0 0; color: var(--checkout-muted); font-size: 12px; line-height: 1.55; text-align: center; }
.checkout-modal__notice.is-error { color: #a52727; }
.checkout-modal__privacy { margin: 18px 0 0; color: var(--checkout-muted); font-size: 11px; line-height: 1.55; }
body.checkout-modal-open { overflow: hidden; }

@media (max-width: 760px) {
  .checkout-modal { align-items: flex-end; padding: 0; }
  .checkout-modal__dialog { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
  .checkout-modal__header, .checkout-modal__section { padding: 22px 20px; }
  .checkout-modal__body { grid-template-columns: 1fr; }
  .checkout-modal__section + .checkout-modal__section { border-left: 0; border-top: 1px solid var(--checkout-line); }
}

@media (max-width: 460px) {
  .checkout-modal__grid, .checkout-modal__card-grid { grid-template-columns: 1fr; }
  .checkout-modal__field--wide { grid-column: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .checkout-modal__dialog { opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .2s ease, transform .2s ease; }
  .checkout-modal.is-open .checkout-modal__dialog { opacity: 1; transform: none; }
}
