/* ============================================================
   UnlockTool Seller — Styles
   Compact single-card layout with modern e-wallet picker
   ============================================================ */

/* ---- Design tokens ---- */
:root {
  --bg: #0d0c11;
  --paper: #16151d;
  --ink: #e8e4f0;
  --muted: #8a8498;
  --line: #2c2936;
  --accent: #c49a3c;
  --accent-deep: #e8b84b;
  --ok: #26c775;
  --warn: #e8943a;
  --error: #e05060;
  --shadow-card: 0 32px 80px rgba(0, 0, 0, 0.55), 0 4px 16px rgba(0, 0, 0, 0.38);
  --radius-card: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: 108%;
}
html,
body {
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% -10%, rgba(196, 154, 60, 0.12), transparent 36%),
    radial-gradient(circle at 10% 25%, rgba(80, 60, 160, 0.09), transparent 30%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: "Prata", serif;
  line-height: 1.2;
  margin-top: 0;
}

/* ---- Noise overlay ---- */
.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.17;
  background-image: radial-gradient(rgba(0, 0, 0, 0.06) 0.45px, transparent 0.45px);
  background-size: 3px 3px;
}

/* ---- Footer container utility ---- */
.container {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

/* ===========================================================
   MAIN WRAP — centers the card vertically
   =========================================================== */
.main-wrap {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 50px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem 0.8rem 0.7rem;
}

/* ===========================================================
   CHECKOUT CARD — outer shell
   =========================================================== */
.checkout-card {
  width: min(660px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  /* overflow: clip — visually sama dengan hidden tapi tidak jadi scroll container,
     sehingga position: sticky pada .checkout-cta-bar di dalam card tetap bekerja */
  overflow: clip;
  animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Card header bar ---- */
.card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.56rem;
  padding: 0.72rem 1.08rem;
  border-bottom: 1px solid var(--line);
  background: rgba(22, 21, 29, 0.85);
}

.brand {
  font-family: "Prata", serif;
  font-size: 0.96rem;
  letter-spacing: 0.01em;
  margin-right: auto;
}

.header-link {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.62rem;
}

.header-link:hover {
  border-color: var(--accent);
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ok);
  background: rgba(15, 122, 68, 0.08);
  border: 1px solid rgba(15, 122, 68, 0.22);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
}

.promo-strip {
  border-bottom: 1px solid var(--line);
  padding: 0.56rem 1.08rem;
  background: linear-gradient(90deg, rgba(196, 154, 60, 0.18), rgba(196, 154, 60, 0.04));
}

.promo-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.promo-caption {
  margin: 0.18rem 0 0;
  font-size: 0.72rem;
  color: #ddd4bc;
}

/* ===========================================================
   PACKAGE SELECTOR
   =========================================================== */
.pkg-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.82rem 1.08rem;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 17, 24, 0.6);
}

.package-loading {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.package-card {
  position: relative;
  background: #1e1c28;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.56rem 0.42rem 0.52rem;
  cursor: pointer;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.package-card:hover,
.package-card:focus-visible {
  border-color: rgba(160, 118, 48, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(120, 84, 26, 0.1);
  outline: none;
}

.package-card.selected {
  border-color: var(--accent);
  background: linear-gradient(155deg, #231f14, #2a2210);
  box-shadow: 0 0 0 3px rgba(196, 154, 60, 0.18);
}

/* "Terlaris" badge */
.pkg-badge {
  display: none;
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #000;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.package-card.featured .pkg-badge {
  display: inline-block;
}

.pkg-dur {
  margin: 0 0 0.14rem;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-deep);
}

.pkg-name {
  margin: 0 0 0.24rem;
  font-family: "Prata", serif;
  font-size: 0.84rem;
  line-height: 1.2;
}

.pkg-price {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.pkg-price-original {
  font-size: 0.8rem;
  color: var(--error);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  margin-bottom: 0.1rem;
}

.pkg-price-promo {
  color: var(--ok);
}

/* ===========================================================
   FORM WRAP
   =========================================================== */
.form-wrap {
  padding: 0.9rem 1.08rem 1rem;
}

.form-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  align-items: start;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}

/* ---- Text input field ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.field-label,
.field > span.field-label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Wrapper konsisten untuk semua input teks */
.input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.input-wrap .form-input,
.input-wrap input[type="text"],
.input-wrap input[type="tel"],
.input-wrap input[type="email"],
.input-wrap input[type="password"],
.input-wrap input[type="search"],
.input-wrap input[type="url"],
.input-wrap input[type="number"] {
  flex: 1;
  min-width: 0;
}

.field .form-input,
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="password"],
.field input[type="search"],
.field input[type="url"],
.field input[type="number"] {
  width: 100%;
  min-height: 38px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.52rem 0.66rem;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.35;
  -webkit-appearance: none;
  appearance: none;
  background: #1e1c28;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field .form-input::placeholder,
.field input[type="text"]::placeholder,
.field input[type="tel"]::placeholder,
.field input[type="email"]::placeholder,
.field input[type="password"]::placeholder,
.field input[type="search"]::placeholder,
.field input[type="url"]::placeholder,
.field input[type="number"]::placeholder {
  color: #504d5e;
}

.field .form-input:focus,
.field input[type="text"]:focus,
.field input[type="tel"]:focus,
.field input[type="email"]:focus,
.field input[type="password"]:focus,
.field input[type="search"]:focus,
.field input[type="url"]:focus,
.field input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 154, 60, 0.14);
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.12rem;
  padding: 0.12rem 0.05rem;
  cursor: pointer;
}

.consent-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 0.12rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.consent-check span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.consent-check:hover span {
  color: var(--ink);
}

.field small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.anti-spam-input {
  display: none !important;
}

/* ---- Trust list ---- */
.trust-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.trust-list li {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.trust-list li::before {
  content: '';
  display: inline-block;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: var(--ok);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6l2 2 4.5-4.5' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 11px 11px;
  background-position: center;
  background-repeat: no-repeat;
}

/* ===========================================================
   E-WALLET PICKER
   =========================================================== */
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.34rem;
  margin-top: 0.28rem;
}

.wallet-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.36rem;
  padding: 0.42rem 0.46rem 0.4rem 0.42rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #1e1c28;
  -webkit-user-select: none;
  user-select: none;
  text-align: left;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}

.wallet-card:hover {
  border-color: rgba(196, 154, 60, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.wallet-card:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 154, 60, 0.18);
}

.wallet-card:has(input:focus-visible) {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 154, 60, 0.18);
}

/* Hide native radio input */
.wallet-card input[type="radio"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.wallet-gopay {
  --ico-bg: #00aa5b;
}

.wallet-card.wallet-gopay {
  min-height: 36px;
  padding-top: 0.36rem;
  padding-bottom: 0.34rem;
}

.wallet-shopeepay {
  --ico-bg: #ef4f2f;
}

.wallet-dana {
  --ico-bg: #0396d6;
}

.wallet-ovo {
  --ico-bg: #4c4f56;
}

.wallet-qris {
  --ico-bg: #6f6f77;
}

/* Selected state via class + :has() for broader support */
.wallet-card.is-selected,
.wallet-card:has(input:checked) {
  border-color: var(--accent);
  background: linear-gradient(155deg, #231f14, #2a2210);
  box-shadow: 0 0 0 2.5px rgba(196, 154, 60, 0.22);
}

/* Desktop layout: stack e-wallet options vertically so full payment names are visible */
@media (min-width: 900px) {
  .wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-card {
    align-items: center;
    text-align: left;
  }

  .wallet-name {
    white-space: nowrap;
  }
}

/* Colored brand icon box */
.wallet-ico {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 12px;
  background: var(--ico-bg, #888);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.wallet-ico svg {
  width: 56%;
  height: 56%;
  display: block;
}

.wallet-name {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 1.8rem);
}

/* Check badge top-right corner */
.wallet-tick {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
}

.wallet-card.is-selected .wallet-tick,
.wallet-card:has(input:checked) .wallet-tick {
  display: flex;
}

/* ===========================================================
   ORDER SUMMARY BAR
   =========================================================== */
.summary-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.46rem;
  background: linear-gradient(155deg, #231f14, #2a2210);
  border: 1px dashed rgba(196, 154, 60, 0.36);
  border-radius: var(--radius-sm);
  padding: 0.36rem 0.5rem;
}

.summary-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "label title"
    "discount discount";
  align-items: center;
  column-gap: 0.38rem;
  row-gap: 0.04rem;
  min-width: 0;
}

.summary-label {
  grid-area: label;
  margin: 0;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--muted);
}

.summary-title {
  grid-area: title;
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
}

.summary-discount {
  grid-area: discount;
  margin: 0;
  font-size: 0.66rem;
  color: #d5cca8;
}

.summary-discount:empty {
  display: none;
}

.summary-price {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--accent-deep);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

/* ===========================================================
   BUTTONS
   =========================================================== */
.btn-primary,
.btn-secondary,
.btn-ghost {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  padding: 0 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-primary {
  margin-top: 0.62rem;
  width: 100%;
  font-size: 0.88rem;
  background: linear-gradient(145deg, var(--accent), #a87e28);
  color: #0d0c11;
  box-shadow: 0 4px 18px rgba(196, 154, 60, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(196, 154, 60, 0.42);
}

.btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.btn-secondary {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
}

.btn-secondary:hover { opacity: 0.87; }

.btn-ghost {
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }

/* ---- Form status message ---- */
/* ===========================================================
   CHECKOUT CTA BAR — wraps summary-bar + pay button
   Sticky bottom on small screens when vertical scroll is active
   =========================================================== */
.checkout-cta-bar {
  /* Desktop / no-scroll: normal flow, nothing special */
}

.form-message {
  min-height: 1.2rem;
  margin: 0.36rem 0 0;
  font-size: 0.76rem;
  text-align: center;
}

.form-message.error   { color: var(--error); }
.form-message.success { color: var(--ok); }

/* ===========================================================
   RESULT CARD
   =========================================================== */
.result-card {
  margin: 0 1.08rem 0.92rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.86rem;
  background: #1e1c28;
  animation: card-in 0.35s ease both;
}

.result-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.order-id-text {
  margin: 0 0 0.75rem;
  font-size: 0.83rem;
  color: var(--muted);
}

.result-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.status-message {
  margin: 0.56rem 0 0;
  font-size: 0.78rem;
}

.status-message.pending { color: var(--warn); }
.status-message.success { color: var(--ok); }
.status-message.failed  { color: var(--error); }

.status-detail-wrap {
  margin-top: 0.85rem;
  border: 1px solid #342f43;
  border-radius: 10px;
  background: #1a1725;
  padding: 0.72rem;
}

.status-detail-wrap h4 {
  margin: 0 0 0.45rem;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  color: #ddd4bc;
}

.status-detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(110px, 155px) 1fr;
  gap: 0.34rem 0.6rem;
}

.status-detail-list dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.status-detail-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  word-break: break-word;
}

/* ===========================================================
   FOOTER
   =========================================================== */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(196, 154, 60, 0.12);
  padding: 0.62rem 0 0.82rem;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-card {
  width: min(520px, 100%);
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #171521;
  box-shadow: 0 30px 75px rgba(0, 0, 0, 0.48);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 1rem;
}

.modal-head h3 {
  margin: 0;
  font-size: 1rem;
}

.modal-close-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 34px;
  padding: 0 0.7rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.modal-body {
  padding: 0.9rem 1rem 1rem;
  display: grid;
  gap: 0.6rem;
}

.modal-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.credential-row {
  border: 1px solid #332f42;
  border-radius: 10px;
  padding: 0.62rem;
  display: grid;
  grid-template-columns: 86px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  background: #1f1c2b;
}

.credential-label {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
}

.credential-value {
  margin: 0;
  font-weight: 700;
  word-break: break-all;
}

.copy-inline-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 34px;
  padding: 0 0.68rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.modal-copy-message {
  margin: 0;
  min-height: 1rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.modal-card-compact {
  width: min(430px, 100%);
}

.modal-body-compact {
  gap: 0.5rem;
}

.validation-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.validation-message {
  margin: 0;
  color: #f2d59f;
  font-size: 0.9rem;
  line-height: 1.42;
}

.validation-ok-btn {
  margin-top: 0.16rem;
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 580px) {
  html {
    font-size: 100%;
  }

  .main-wrap {
    padding: 0.78rem 0.55rem 1rem;
    align-items: flex-start;
  }

  .checkout-card {
    border-radius: 18px;
  }

  .card-header {
    padding: 0.8rem 1rem;
    gap: 0.4rem;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .brand {
    max-width: 100%;
    font-size: 0.98rem;
    line-height: 1.25;
    margin-right: 0;
    flex: 1 1 100%;
  }

  .secure-badge {
    font-size: 0.68rem;
    padding: 0.18rem 0.5rem;
    white-space: nowrap;
  }

  .promo-strip {
    padding: 0.68rem 1rem;
  }

  .pkg-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 1rem;
    gap: 0.5rem;
  }

  .package-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .pkg-name {
    font-size: 0.88rem;
  }

  .pkg-price {
    font-size: 1.05rem;
  }

  .form-wrap {
    padding: 1rem;
  }

  .form-body {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .wallet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.38rem;
  }

  .wallet-ico {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 0.63rem;
  }

  .wallet-name {
    font-size: 0.6rem;
  }

  .wallet-card {
    padding: 0.44rem 0.16rem 0.36rem;
  }

  .wallet-card.wallet-gopay {
    min-height: 38px;
    padding-top: 0.37rem;
    padding-bottom: 0.32rem;
  }

  .summary-bar {
    align-items: flex-start;
    gap: 0.42rem;
    padding: 0.46rem 0.6rem;
  }

  .summary-price {
    margin-left: auto;
  }

  .summary-price {
    font-size: 1.25rem;
  }

  /* Sticky CTA bar: hanya aktif saat scroll vertikal ada (layar kecil).
     position:sticky bottom:0 secara alami hanya 'stick' saat ada overflow,
     jika halaman muat penuh tanpa scroll maka elemen tetap di posisi normal. */
  .checkout-cta-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    /* bleed ke tepi card supaya background seamless */
    margin: 0.2rem -0.72rem -0.72rem;
    padding: 0.5rem 0.72rem calc(0.56rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to bottom, transparent 0px, var(--paper) 14px);
    border-top: 1px solid var(--line);
  }

  /* Hapus margin-top summary-bar karena padding-top cta-bar sudah jadi spacer */
  .checkout-cta-bar .summary-bar {
    margin-top: 0;
  }

  .result-card {
    margin: 0 1rem 1rem;
  }

  .status-detail-list {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .status-detail-list dt {
    font-size: 0.72rem;
  }

  .status-detail-list dd {
    margin-bottom: 0.38rem;
  }

  .credential-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  html {
    font-size: 100%;
  }

  .main-wrap {
    padding: 1rem 0.55rem 1.4rem;
  }

  .checkout-card {
    border-radius: 16px;
  }

  .card-header {
    padding: 0.72rem 0.8rem;
  }

  .brand {
    max-width: 70%;
    font-size: 0.9rem;
  }

  .pkg-selector {
    padding: 0.82rem 0.72rem;
    gap: 0.45rem;
  }

  .package-card {
    padding: 0.62rem 0.38rem 0.58rem;
  }

  .pkg-dur {
    letter-spacing: 0.08em;
  }

  .form-wrap {
    padding: 0.82rem;
  }

  .field-label,
  .field > span.field-label {
    letter-spacing: 0.04em;
  }

  .wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .wallet-card {
    padding: 0.38rem 0.14rem 0.34rem;
  }

  .wallet-card.wallet-gopay {
    min-height: 35px;
    padding-top: 0.34rem;
    padding-bottom: 0.28rem;
  }

  .wallet-name {
    font-size: 0.62rem;
  }

  .consent-check span,
  .field small,
  .trust-list li {
    font-size: 14px;
  }

  .summary-label {
    font-size: 0.64rem;
  }

  .summary-price {
    font-size: 1.08rem;
  }

  /* form-wrap padding 0.82rem di breakpoint ini — sesuaikan bleed */
  .checkout-cta-bar {
    margin: 0.2rem -0.82rem -0.82rem;
    padding-left: 0.82rem;
    padding-right: 0.82rem;
  }
}

@media (max-width: 360px) {
  html {
    font-size: 95%;
  }

  .main-wrap {
    padding: 0.88rem 0.45rem 1.15rem;
  }

  .card-header {
    padding: 0.62rem 0.7rem;
  }

  .brand {
    font-size: 0.84rem;
  }

  .secure-badge {
    font-size: 0.62rem;
    padding: 0.16rem 0.48rem;
  }

  .pkg-selector {
    padding: 0.68rem;
  }

  .pkg-price {
    font-size: 1rem;
  }

  .form-wrap {
    padding: 0.72rem;
  }

  .summary-bar {
    padding: 0.5rem 0.56rem;
  }

  .summary-title {
    font-size: 0.84rem;
  }

  .summary-price {
    font-size: 1rem;
  }

  .btn-primary {
    min-height: 44px;
    font-size: 0.94rem;
  }

  .result-card {
    margin: 0 0.72rem 0.82rem;
    padding: 0.9rem;
  }

  /* form-wrap padding kembali ke 0.72rem — reset bleed ke nilai awal */
  .checkout-cta-bar {
    margin: 0.2rem -0.72rem -0.72rem;
    padding-left: 0.72rem;
    padding-right: 0.72rem;
  }
}
