/* ==========================================================================
   Checkout & status pembayaran Midtrans (2026-11-01). Token warna dari home.css (--th-*), mode gelap dari theme-dark.css.
   Desktop: form kiri, ringkasan kanan (sticky). HP: ringkasan di atas form.
   ========================================================================== */

.th-co { background: linear-gradient(180deg, var(--th-primary-soft) 0, transparent 360px); }
.th-co-wrap { padding: 28px 0 72px; }
.th-co-narrow { max-width: 760px; }

.th-co-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--th-primary); font-weight: 600; font-size: 14px; text-decoration: none; }
.th-co-back:hover { color: var(--th-accent); }

/* langkah 1-2-3 */
.th-co-steps { display: flex; gap: 8px; list-style: none; margin: 0 0 18px; padding: 0; counter-reset: s; }
.th-co-steps li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--th-border); color: var(--th-muted); font-size: 14px; font-weight: 600; line-height: 1.25; }
.th-co-steps li span { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: var(--th-primary-soft); color: var(--th-primary); font-size: 13px; }
.th-co-steps li.is-active { border-color: var(--th-accent); color: var(--th-text); box-shadow: 0 0 0 3px var(--th-accent-soft); }
.th-co-steps li.is-active span { background: var(--th-accent); color: #fff; }
.th-co-steps li.is-done span { background: #17895a; color: #fff; }

.th-co .th-co-sandbox { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 10px 14px; border-radius: 12px; background: #fff6db; border: 1px solid #f1d98a; color: #6b5000; font-size: 14px; }

.th-co-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 22px; align-items: start; }
.th-co-grid .th-co-form { grid-column: 1; grid-row: 1; }
.th-co-grid .th-co-sum { grid-column: 2; grid-row: 1; position: sticky; top: 96px; }

.th-co-card { background: #fff; border: 1px solid var(--th-border); border-radius: var(--th-radius); box-shadow: var(--th-shadow); padding: 26px; }
.th-co .th-co-kicker { margin: 0 0 12px; color: var(--th-accent); font: 700 12px/1.2 poppins, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.th-co .th-co-title { margin: 0 0 6px; color: var(--th-primary-dark); font: 700 24px/1.25 poppins, sans-serif; }
.th-co .th-co-lead { margin: 0 0 20px; color: var(--th-muted); font-size: 15px; line-height: 1.6; }

/* form */
.th-co-field { margin-bottom: 16px; }
.th-co-field label { display: block; margin-bottom: 6px; color: var(--th-text); font-weight: 600; font-size: 14px; }
.th-co-field input { width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--th-border); border-radius: 12px; background: #fff; color: var(--th-text); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.th-co-field input:focus { outline: none; border-color: var(--th-primary); box-shadow: 0 0 0 3px rgba(9, 78, 93, .14); }
.th-co-field input.is-invalid { border-color: #c9352b; box-shadow: 0 0 0 3px rgba(201, 53, 43, .12); }
.th-co-field small { display: block; margin-top: 5px; color: var(--th-muted); font-size: 13px; line-height: 1.45; }
.th-co-err { display: block; color: #c9352b; font-size: 13px; font-style: normal; font-weight: 600; }
.th-co-err:empty { display: none; }

.th-co-alert { margin: 4px 0 16px; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; background: #fdecea; color: #8a2a22; border: 1px solid #f3c9c4; }
.th-co-alert.is-info { background: var(--th-primary-soft); color: var(--th-primary-dark); border-color: var(--th-border); }
.th-co-alert.is-warn { background: #fff6db; color: #6b5000; border-color: #f1d98a; }
.th-co-alert ul { margin: 6px 0 0; padding-left: 18px; }
.th-co-alert a { font-weight: 700; color: inherit; text-decoration: underline; }

.th-co-pay { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px; }
.th-co-pay b { font-size: 17px; white-space: nowrap; }
.th-co-pay.is-busy { opacity: .8; cursor: progress; }
.th-co-pay.is-busy .th-co-pay-text::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: th-co-spin .8s linear infinite; }
@keyframes th-co-spin { to { transform: rotate(360deg); } }

.th-co .th-co-secure { display: flex; gap: 8px; margin: 14px 0 10px; color: var(--th-muted); font-size: 13px; line-height: 1.5; }
.th-co-secure i { margin-top: 3px; color: #17895a; }
.th-co-methods { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.th-co-methods li { padding: 3px 9px; border-radius: 999px; background: var(--th-primary-soft); color: var(--th-primary-dark); font-size: 12px; font-weight: 600; }

/* ringkasan */
.th-co-prod { display: flex; gap: 14px; align-items: flex-start; }
.th-co-prod img { flex: 0 0 112px; width: 112px; height: 84px; object-fit: cover; border-radius: 10px; background: var(--th-primary-soft); }
.th-co-prod h2 { margin: 6px 0 4px; color: var(--th-primary-dark); font: 700 17px/1.35 poppins, sans-serif; }
.th-co-prod small { color: var(--th-muted); font-size: 13px; }
.th-co-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--th-primary-soft); color: var(--th-primary); font: 700 11px/1.6 poppins, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.th-co-tag.is-best { background: var(--th-accent); color: #fff; }
.th-co .th-co-sub { margin: 16px 0 8px; color: var(--th-muted); font-size: 14px; }
.th-co-items { margin: 0; padding: 0; list-style: none; counter-reset: it; border-top: 1px solid var(--th-border); }
.th-co-items li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--th-border); font-size: 14px; counter-increment: it; }
.th-co-items li span { color: var(--th-text); font-weight: 600; }
.th-co-items li span::before { content: counter(it) ". "; color: var(--th-muted); }
.th-co-items li small { display: block; margin-top: 2px; color: var(--th-muted); font-weight: 400; font-size: 12px; }
.th-co-items li b { color: var(--th-muted); font-weight: 600; white-space: nowrap; }
.th-co-total { margin: 14px 0 0; }
.th-co-total div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; color: var(--th-muted); }
.th-co-total dd { margin: 0; }
.th-co-total .is-save dd { color: #17895a; font-weight: 700; }
.th-co-total .is-grand { margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--th-border); color: var(--th-text); }
.th-co-total .is-grand dt { font-weight: 700; }
.th-co-total .is-grand dd { color: var(--th-primary-dark); font: 700 22px/1.2 poppins, sans-serif; }
.th-co-inc { margin: 16px 0 0; padding: 14px 0 0; list-style: none; border-top: 1px solid var(--th-border); }
.th-co-inc li { display: flex; gap: 8px; margin: 6px 0; font-size: 14px; color: var(--th-text); }
.th-co-inc i { margin-top: 4px; color: #17895a; font-size: 12px; }

/* status */
.th-co-status { text-align: center; padding: 34px 26px; }
.th-co-st-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; font-size: 30px; background: var(--th-primary-soft); color: var(--th-primary); }
.th-co-status.is-paid .th-co-st-icon { background: #e6f6ee; color: #17895a; box-shadow: 0 0 0 8px rgba(23, 137, 90, .08); }
.th-co-status.is-pending .th-co-st-icon, .th-co-status.is-new .th-co-st-icon { background: var(--th-accent-soft); color: var(--th-accent); }
.th-co-status.is-failed .th-co-st-icon, .th-co-status.is-expired .th-co-st-icon { background: #fdecea; color: #c9352b; }
.th-co-status .th-co-lead { max-width: 520px; margin-left: auto; margin-right: auto; }
.th-co-va { margin: 0 auto 20px; max-width: 480px; padding: 18px; border-radius: 14px; border: 1.5px dashed var(--th-accent); background: var(--th-accent-soft); text-align: left; }
.th-co .th-co-va-label { margin: 0 0 6px; color: var(--th-muted); font-size: 13px; font-weight: 600; }
.th-co-va-num { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.th-co-va-num strong { color: var(--th-primary-dark); font: 700 24px/1.2 'Courier New', monospace; letter-spacing: .04em; word-break: break-all; }
.th-co-va dl { margin: 12px 0 0; }
.th-co-va dl div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14px; }
.th-co-va dt { color: var(--th-muted); font-weight: 400; }
.th-co-va dd { margin: 0; font-weight: 700; color: var(--th-text); text-align: right; }
.th-co-countdown { display: block; color: var(--th-accent); font-weight: 600; font-size: 13px; }
.th-co .th-co-va-note { margin: 10px 0 0; color: var(--th-muted); font-size: 13px; }
.th-co-copy { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--th-primary); border-radius: 999px; background: #fff; color: var(--th-primary); font-size: 13px; font-weight: 700; cursor: pointer; }
.th-co-copy.is-sm { padding: 2px 7px; margin-left: 4px; font-size: 12px; }
.th-co-copy.is-copied { background: #17895a; border-color: #17895a; color: #fff; }
.th-co-got { display: inline-flex; flex-direction: column; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; text-align: left; }
.th-co-got li { display: flex; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--th-primary-soft); color: var(--th-primary-dark); font-weight: 600; font-size: 15px; }
.th-co-got i { margin-top: 3px; color: var(--th-accent); }
.th-co .th-co-note { margin: 0 auto 14px; max-width: 520px; color: var(--th-muted); font-size: 14px; }
.th-co-next { max-width: 480px; margin: 0 auto 6px; padding-left: 20px; text-align: left; color: var(--th-text); font-size: 15px; line-height: 1.6; }
.th-co-next li { margin: 4px 0; }
.th-co-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }

.th-co-order { margin-top: 18px; }
.th-co-order dl { margin: 0; }
.th-co-order dl div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--th-border); font-size: 14px; }
.th-co-order dt { color: var(--th-muted); font-weight: 400; }
.th-co-order dd { margin: 0; color: var(--th-text); overflow-wrap: anywhere; }
.th-co-order dd small { display: block; margin-top: 2px; color: var(--th-muted); font-size: 12px; }
.th-co-order code { padding: 2px 6px; border-radius: 6px; background: var(--th-primary-soft); color: var(--th-primary-dark); font-size: 13px; }
.th-co .th-co-help { margin: 14px 0 0; color: var(--th-muted); font-size: 14px; }
.th-co-help a { color: #128c4b; font-weight: 700; text-decoration: none; }

@media (max-width: 991px) {
    .th-co-grid { grid-template-columns: 1fr; }
    .th-co-grid .th-co-sum { grid-column: 1; grid-row: 1; position: static; }
    .th-co-grid .th-co-form { grid-column: 1; grid-row: 2; }
}
@media (max-width: 575px) {
    .th-co-wrap { padding: 18px 0 48px; }
    .th-co-card { padding: 18px; }
    .th-co-steps { gap: 6px; }
    .th-co-steps li { flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 12px; text-align: center; }
    .th-co .th-co-title { font-size: 21px; }
    .th-co-prod img { flex-basis: 84px; width: 84px; height: 64px; }
    .th-co-va-num strong { font-size: 20px; }
    .th-co-order dl div { grid-template-columns: 1fr; gap: 2px; }
    .th-co-actions .th-btn { width: 100%; }
}

/* ---------- mode gelap ---------- */
:root[data-theme="dark"] .th-co { background: none; }
:root[data-theme="dark"] .th-co-card,
:root[data-theme="dark"] .th-co-steps li,
:root[data-theme="dark"] .th-co-field input,
:root[data-theme="dark"] .th-co-copy { background: var(--th-dk-card); border-color: var(--th-dk-line); color: var(--th-dk-text); }
:root[data-theme="dark"] .th-co-title,
:root[data-theme="dark"] .th-co-prod h2,
:root[data-theme="dark"] .th-co-total .is-grand dd,
:root[data-theme="dark"] .th-co-va-num strong { color: var(--th-dk-head); }
:root[data-theme="dark"] .th-co-back,
:root[data-theme="dark"] .th-co-copy,
:root[data-theme="dark"] .th-co-steps li span,
:root[data-theme="dark"] .th-co-tag:not(.is-best),
:root[data-theme="dark"] .th-co-methods li,
:root[data-theme="dark"] .th-co-got li,
:root[data-theme="dark"] .th-co-order code { color: var(--th-dk-link); }
:root[data-theme="dark"] .th-co-copy { border-color: var(--th-dk-link); }
:root[data-theme="dark"] .th-co-field input:focus { border-color: var(--th-dk-link); box-shadow: 0 0 0 3px rgba(255, 168, 107, .18); }
:root[data-theme="dark"] .th-co-sandbox,
:root[data-theme="dark"] .th-co-alert.is-warn { background: #3a3012; border-color: #6b5a1c; color: #f3dc8f; }
:root[data-theme="dark"] .th-co-alert { background: #3a1d1a; border-color: #6e2f29; color: #f4b8b1; }
:root[data-theme="dark"] .th-co-alert.is-info { background: var(--th-dk-card-2); border-color: var(--th-dk-line); color: var(--th-dk-text); }
:root[data-theme="dark"] .th-co-status.is-paid .th-co-st-icon { background: #173a2b; color: #5fd39c; }
:root[data-theme="dark"] .th-co-status.is-failed .th-co-st-icon,
:root[data-theme="dark"] .th-co-status.is-expired .th-co-st-icon { background: #3a1d1a; color: #f08d82; }
:root[data-theme="dark"] .th-co-total .is-save dd,
:root[data-theme="dark"] .th-co-inc i,
:root[data-theme="dark"] .th-co-secure i { color: #5fd39c; }

/* sandbox: QR + URL untuk simulator QRIS (penguji di HP tidak perlu menyalin alamat gambar dari popup) */
.th-co-simqr { margin: 0 auto 20px; max-width: 480px; padding: 16px; border-radius: 14px; border: 1.5px dashed #c9a227; background: #fffbea; text-align: left; }
.th-co .th-co-simqr-title { margin: 0 0 10px; color: #6b5000; font-weight: 700; font-size: 14px; }
.th-co-simqr img { display: block; width: 180px; height: 180px; margin: 0 auto 12px; background: #fff; border-radius: 8px; }
.th-co-simqr ol { margin: 0; padding-left: 20px; font-size: 14px; color: var(--th-text); line-height: 1.55; }
.th-co-simqr li + li { margin-top: 6px; }
.th-co-simqr-url { display: flex; gap: 8px; margin-top: 6px; }
.th-co-simqr-url input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--th-border); border-radius: 8px; background: #fff; color: var(--th-text); font: 12px/1 'Courier New', monospace; }
:root[data-theme="dark"] .th-co-simqr { background: #2e2810; border-color: #6b5a1c; }
:root[data-theme="dark"] .th-co .th-co-simqr-title { color: #f3dc8f; }
:root[data-theme="dark"] .th-co-simqr-url input { background: var(--th-dk-card); border-color: var(--th-dk-line); color: var(--th-dk-text); }
