/* V4.1: escolha do provedor externo e resultado. Identidade de simple.css. */
.checkout-page {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  min-width: 0;
}

.checkout-page[hidden],
.checkout-page [hidden] {
  display: none !important;
}

.checkout-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 17px;
}

.checkout-heading > * { min-width: 0; }
.checkout-heading h1 { margin: 0 0 7px; font-size: 27px; }
.checkout-heading p { margin: 0; max-width: 65ch; color: var(--muted); font-size: 13px; }
.checkout-back { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-bottom: 10px; font-size: 12px; }

.checkout-steps {
  display: flex;
  gap: 12px;
  padding: 0;
  margin: 0 0 18px;
  list-style: none;
  counter-reset: checkout-step;
}

.checkout-steps li {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 2px 11px;
  border-bottom: 2px solid var(--border);
  color: #667980;
  font-size: 12px;
  line-height: 1.4;
  counter-increment: checkout-step;
}

.checkout-steps li::before {
  content: counter(checkout-step);
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  height: 24px;
  border: 1px solid #cfdadd;
  border-radius: 50%;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.checkout-steps .is-current { border-color: var(--blue); color: var(--blue-dark); font-weight: 700; }
.checkout-steps .is-current::before { background: var(--blue); border-color: var(--blue); color: #fff; }
.checkout-steps .is-done { border-color: #9fbabd; color: #476c75; }
.checkout-steps .is-done::before { background: #e5eff0; border-color: #a6c0c5; color: #315e6b; }

.checkout-note {
  padding: 10px 13px;
  margin: 0 0 18px;
  border: 1px solid #dedbca;
  border-radius: 4px;
  background: #f8f6eb;
  color: #75643b;
  font-size: 12px;
  line-height: 1.55;
}

.checkout-note p:last-child { margin-bottom: 0; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 20px; }
.checkout-layout > * { min-width: 0; }

.checkout-card,
.checkout-summary {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--paper);
  box-shadow: 0 2px 4px #263a4203;
}

.checkout-card { margin-bottom: 16px; }
.checkout-card:last-child { margin-bottom: 0; }
.checkout-card > h2 { margin-bottom: 16px; font-size: 18px; }
.checkout-card > h3 { font-size: 16px; }
.checkout-card > p { font-size: 13px; }
.checkout-card > :last-child { margin-bottom: 0; }
.checkout-summary { position: sticky; top: 18px; padding: 20px; }
.checkout-summary > h2 { margin-bottom: 16px; font-size: 17px; }
.checkout-summary > h3 { font-size: 15px; }

.checkout-info {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr);
  gap: 10px 12px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.checkout-info > div { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); gap: 12px; }
.checkout-info dt { color: #687b83; }
.checkout-info dd { min-width: 0; margin: 0; color: var(--ink); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.checkout-info dd small { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; color: var(--muted); }

.checkout-code {
  display: inline-block;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px dashed #9ab4bf;
  border-radius: 4px;
  background: #edf3f4;
  color: #2a596c;
  font: 700 13px/1.5 Consolas, "Liberation Mono", monospace;
  letter-spacing: .4px;
  overflow-wrap: anywhere;
  user-select: all;
}

.checkout-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding-top: 15px;
  margin-top: 17px;
  border-top: 1px solid #e0e7e9;
  color: #516c78;
  font-size: 13px;
}

.checkout-total strong { font-size: 25px; line-height: 1.2; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.checkout-total small { font-size: 11px; font-weight: 400; color: var(--muted); }
.checkout-summary-note { margin: 12px 0 0; color: #667980; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.checkout-summary .checkout-status { margin-bottom: 15px; }
.checkout-summary .checkout-actions { margin-top: 16px; padding-top: 15px; }

.payment-group { min-width: 0; padding: 0; margin: 0; border: 0; }
.payment-group + .payment-group { margin-top: 20px; }
.payment-group legend { width: 100%; padding: 0; margin-bottom: 12px; color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1.4; }

.payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 70px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid #d4dfe2;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.payment-option:last-child { margin-bottom: 0; }
.payment-option:hover { border-color: #a0bac3; background: #f7f9f9; }
.payment-option input[type="radio"] { flex: 0 0 17px; width: 17px; height: 17px; margin: 0; accent-color: var(--blue); }
.payment-option:has(input:checked),
.payment-option.is-selected { border-color: var(--blue); background: #edf4f5; box-shadow: inset 3px 0 0 var(--blue); }
.payment-option:has(input:disabled) { border-color: #dce3e5; background: #f6f7f7; cursor: not-allowed; box-shadow: none; }
.payment-option:has(input:focus-visible) { outline: 3px solid #e7b85f; outline-offset: 3px; }
.payment-icon { display: grid; place-items: center; flex: 0 0 39px; width: 39px; height: 39px; border: 1px solid #dce7e9; border-radius: 4px; background: #f2f6f7; color: var(--blue); }
.payment-icon svg { display: block; width: 24px; height: 24px; }
.payment-option:has(input:checked) .payment-icon { background: #fff; border-color: #c8dbdf; }
.payment-description { display: block; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.payment-description strong { display: block; color: #2e5262; font-size: 13px; line-height: 1.4; }
.payment-description small { display: block; margin-top: 3px; color: #677b84; font-size: 11px; line-height: 1.45; }

.provider-option { min-height: 88px; gap: 14px; padding: 17px; }
.provider-option .payment-description strong { font-size: 16px; }
.provider-option .payment-description small { font-size: 12px; }
.provider-monogram { display: grid; place-items: center; flex: 0 0 44px; height: 42px; border-radius: 7px; font: 700 17px/1 Arial, sans-serif; }
.provider-monogram--mercadopago { color: #096b94; background: #e7f5fb; border: 1px solid #c4e8f7; }
.provider-monogram--paypal { color: #173d78; background: #edf2fb; border: 1px solid #d5e1f3; font-size: 26px; font-style: italic; }
.provider-external { margin-left: auto; color: #6b838e; font-size: 21px; }
.gateway-explanation { margin: 20px 0 0; padding: 13px 14px; border: 1px solid #dce6e9; border-radius: 4px; background: #f4f8f9; color: #536e7a; font-size: 12px; line-height: 1.65; }
.gateway-explanation > span { margin-right: 4px; }
.gateway-result { display: flex; gap: 14px; align-items: center; margin: 20px 0; }
.gateway-result h2 { margin: 0 0 5px; font-size: 23px; }
.gateway-result p { margin: 0; color: #627b87; font-size: 13px; }
.gateway-clock { display: grid; place-items: center; flex: 0 0 48px; height: 48px; background: #fff7e0; border: 1px solid #e6d7ae; border-radius: 50%; color: #795b1c; font-size: 30px; }
.gateway-check-note { margin-top: 14px; }

.checkout-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 18px; margin-top: 20px; border-top: 1px solid #e0e7e9; }
.checkout-actions .btn { min-height: 40px; }
.checkout-actions .checkout-back { margin: 0; }
.checkout-actions .field { flex: 1 1 180px; }

.payment-preview { min-width: 0; padding: 16px; margin: 16px 0; border: 1px solid #dbe5e8; border-radius: 4px; background: #f5f8f8; }
.payment-preview h3 { margin-bottom: 9px; font-size: 16px; }
.payment-preview p { font-size: 13px; }
.payment-preview > :last-child { margin-bottom: 0; }

.demo-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; gap: 10px 14px; margin: 15px 0; }
.demo-fields > div { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; gap: 14px; }
.demo-fields dt { color: #617881; font-size: 12px; }
.demo-fields dd { min-width: 0; padding: 9px 11px; margin: 0; border: 1px solid #d9e3e6; border-radius: 3px; background: #fff; color: #3e5d6a; font-size: 13px; overflow-wrap: anywhere; }
.demo-fields dd small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.payment-qr { display: grid; place-items: center; width: min(100%, 220px); aspect-ratio: 1; padding: 16px; margin: 18px auto; border: 1px solid #ccdce1; border-radius: 4px; background: #fff; }
.payment-qr svg { display: block; width: 100%; max-width: 184px; height: auto; }
.payment-code { display: block; max-width: 100%; padding: 12px; margin: 12px 0; border: 1px dashed #a9bec6; border-radius: 4px; background: #edf3f4; color: #345c6c; font: 12px/1.65 Consolas, "Liberation Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }

.checkout-status { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 25px; padding: 4px 8px; border: 1px solid #d2e0e5; border-radius: 3px; background: #edf3f5; color: #3b6273; font-size: 11px; font-weight: 700; line-height: 1.4; }
.checkout-status--approved { border-color: #c8dfd0; background: #edf7f0; color: #2f6c49; }
.checkout-status--pending { border-color: #e6d7ae; background: #fff7e0; color: #795b1c; }
.checkout-status--rejected { border-color: #e7c9c6; background: #fff0ef; color: #934340; }
.checkout-status--cancelled { border-color: #d8dfe2; background: #eff2f3; color: #5f7078; }
.checkout-status--unpaid { border-color: #d2e0e5; background: #edf3f5; color: #3b6273; }

.payment-outcomes { padding: 0; margin: 18px 0 0; border: 1px solid #d9e3e6; border-radius: 4px; background: #f7f9f9; }
.payment-outcomes > summary { padding: 12px 14px; color: #536f7c; font-size: 12px; font-weight: 700; cursor: pointer; }
.payment-outcomes[open] > summary { border-bottom: 1px solid #e0e7e9; }
.payment-outcomes > .actions { padding: 13px 14px; margin: 0; }
.payment-outcomes > p { margin: 12px 14px; color: var(--muted); font-size: 12px; }
.payment-outcomes .btn { min-height: 36px; font-size: 12px; }

.checkout-alert,
.checkout-success { padding: 14px 16px; margin: 16px 0; border: 1px solid; border-left-width: 3px; border-radius: 4px; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.checkout-alert { border-color: #dfca9c; background: #fff8e9; color: #755825; }
.checkout-success { border-color: #bcd8c6; background: #edf7f0; color: #34664b; }
.checkout-alert > :last-child,
.checkout-success > :last-child { margin-bottom: 0; }
.checkout-alert h2,
.checkout-success h2 { margin-bottom: 8px; font-size: 18px; }
.checkout-alert h3,
.checkout-success h3 { margin-bottom: 7px; font-size: 16px; }
.checkout-alert .actions,
.checkout-success .actions { margin-top: 12px; }

.checkout-page :is(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid #e7b85f; outline-offset: 3px; }
.checkout-page a:not(.btn):hover { text-underline-offset: 3px; }

@media (max-width: 700px) {
  .checkout-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .checkout-summary { position: static; }
  .checkout-card,
  .checkout-summary { padding: 18px; }
  .checkout-heading { margin-bottom: 14px; }
  .checkout-heading h1 { font-size: 24px; }
  .checkout-steps { gap: 8px; margin-bottom: 15px; }
  .checkout-steps li { gap: 6px; font-size: 11px; }
  .checkout-steps li::before { flex-basis: 22px; height: 22px; }
  .checkout-note { margin-bottom: 15px; font-size: 11px; }
  .payment-option { gap: 10px; padding: 12px; }
  .checkout-info { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .checkout-info > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
}

@media (max-width: 400px) {
  .checkout-card,
  .checkout-summary { padding: 15px; }
  .checkout-heading h1 { font-size: 22px; }
  .checkout-steps { gap: 6px; }
  .checkout-steps li { align-items: flex-start; gap: 5px; padding: 7px 0 9px; font-size: 10px; }
  .checkout-steps li::before { flex-basis: 20px; height: 20px; font-size: 10px; }
  .payment-option { gap: 8px; padding: 11px 10px; }
  .payment-icon { flex-basis: 33px; width: 33px; height: 35px; }
  .payment-description strong { font-size: 12px; }
  .payment-description small { font-size: 11px; }
  .payment-preview { padding: 12px; }
  .checkout-info,
  .checkout-info > div { column-gap: 8px; font-size: 11px; }
  .checkout-code { padding: 5px 7px; font-size: 12px; }
  .checkout-total strong { font-size: 23px; }
  .demo-fields,
  .demo-fields > div { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .demo-fields > div + div,
  .demo-fields dd + dt { margin-top: 7px; }
  .checkout-actions { align-items: stretch; }
  .checkout-actions > .btn,
  .checkout-actions > .actions,
  .payment-outcomes .actions > .btn { flex: 1 1 100%; }
  .checkout-actions > .checkout-back { justify-content: center; width: 100%; }
  .checkout-actions > .actions > .btn { flex: 1 1 auto; }
  .checkout-alert,
  .checkout-success { padding: 12px; }
}
