:root {
  --orange: #e8590c;
  --orange-deep: #c94a05;
  --orange-soft: #fff1e6;
  --orange-ring: rgba(232, 89, 12, 0.16);
  --sb-blue: #1b2a66;
  --sb-blue-soft: #eef1fb;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e2dc;
  --bg: #fbfaf8;
  --ok: #1b7a43;
  --err: #b3261e;
  --radius: 20px;
  --shadow-card: 0 1px 2px rgba(28, 25, 23, 0.04), 0 18px 40px -18px rgba(28, 25, 23, 0.16);
  --font: "Plus Jakarta Sans", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 88% -8%, #ffe6d2 0%, rgba(255, 230, 210, 0) 62%),
    radial-gradient(700px 360px at -6% 8%, #fff4e8 0%, rgba(255, 244, 232, 0) 60%),
    var(--bg);
  background-repeat: no-repeat;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(231, 226, 220, 0.8);
}
.head-in {
  max-width: 1040px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 20px; letter-spacing: -0.035em; font-weight: 800; }
.brand strong { color: var(--orange); font-weight: 800; }
.brand img { display: block; border-radius: 10px; box-shadow: 0 4px 10px -4px rgba(232, 89, 12, 0.55); }
.head-note { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }

/* ---------- layout ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 44px 20px 56px; }
.top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 56px; align-items: start; }

/* ---------- hero ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--orange-deep);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px var(--orange-ring); }
.hero h1 { font-size: clamp(32px, 4.6vw, 50px); line-height: 1.06; letter-spacing: -0.04em; font-weight: 800; margin: 0; }
.hero h1 em {
  font-style: normal; color: var(--orange);
  background: linear-gradient(transparent 82%, rgba(232, 89, 12, 0.18) 82%);
  padding-bottom: 2px;
}
/* marka jalur tol */
.lane {
  width: 132px; height: 4px; margin: 22px 0 20px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--orange) 0 16px, transparent 16px 28px);
}
.lead { color: var(--muted); font-size: 17px; margin: 0 0 22px; max-width: 46ch; }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.points li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; color: #44403c; }
.points li::before {
  content: "✓"; flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  color: var(--orange-deep); background: var(--orange-soft);
}

/* ---------- form card ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; display: grid; gap: 18px; box-shadow: var(--shadow-card);
}
label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; color: #57534e; letter-spacing: 0.005em; }
input[type=text], input[type=date], #card {
  font: inherit; font-size: 16px; font-weight: 500; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fcfbfa; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
#card { letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
input::placeholder { color: #a8a29e; font-weight: 400; letter-spacing: 0; }
input:hover { border-color: #d6d0c8; }
input:focus { outline: none; border-color: var(--orange); background: #fff; box-shadow: 0 0 0 4px var(--orange-ring); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* provider chips */
.providers { border: none; padding: 0; margin: 0; min-width: 0; }
.providers legend { font-size: 13px; font-weight: 700; color: #57534e; padding: 0 0 9px; }
.provider-list { display: flex; flex-wrap: wrap; gap: 8px; }
.prov {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; user-select: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
}
.prov:hover { border-color: #d6d0c8; }
.prov:active { transform: scale(0.97); }
.prov input { accent-color: var(--orange); width: 16px; height: 16px; margin: 0; }
.prov:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-deep); }
.prov:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--orange-ring); }
.prov.disabled { opacity: 0.5; cursor: not-allowed; padding: 7px 12px; font-size: 13px; }
.prov.disabled:active { transform: none; }
.prov.disabled em { font-style: normal; font-size: 11px; font-weight: 700; background: var(--line); color: var(--muted); padding: 1px 8px; border-radius: 999px; }
.loading-prov { font-size: 13px; color: var(--muted); }

/* tombol */
button {
  font: inherit; font-size: 16px; font-weight: 800; letter-spacing: -0.01em;
  min-height: 52px; padding: 13px 18px; border: none; border-radius: 13px; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, #f2681b 0%, #e04e07 100%);
  box-shadow: 0 8px 18px -8px rgba(224, 78, 7, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
}
button:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 12px 22px -8px rgba(224, 78, 7, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.28); }
button:active { transform: translateY(0); filter: brightness(0.97); }
button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--orange-ring), 0 8px 18px -8px rgba(224, 78, 7, 0.7); }
button:disabled { opacity: 0.6; cursor: progress; transform: none; filter: none; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; text-align: center; }

/* ---------- status ---------- */
.status {
  margin-top: 28px; padding: 14px 18px; border-radius: 14px;
  background: var(--orange-soft); color: var(--orange-deep); border: 1px solid rgba(232, 89, 12, 0.18);
  font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 10px;
}
.status[hidden] { display: none; }
.status.err { background: #fdecea; color: var(--err); border-color: rgba(179, 38, 30, 0.2); }
.status.busy::before {
  content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid rgba(232, 89, 12, 0.25); border-top-color: var(--orange);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- hasil ---------- */
.results { margin-top: 22px; display: grid; gap: 26px; }
.toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 700; color: var(--muted);
}
.btn-dl { background: var(--ink); font-size: 13.5px; min-height: 0; padding: 9px 15px; border-radius: 10px; box-shadow: none; }
.btn-dl:hover { box-shadow: 0 8px 16px -8px rgba(28, 25, 23, 0.6); }
.empty {
  color: var(--muted); font-size: 14.5px; text-align: center; padding: 36px 20px;
  border: 1.5px dashed var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, 0.6);
}

/* operator block */
.op-block {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-card); animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.op-block:nth-of-type(2) { animation-delay: 0.08s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.op-head { padding: 16px 20px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.op-head h2 { font-size: 17px; margin: 0; letter-spacing: -0.02em; font-weight: 800; }
.op-sum { font-size: 13px; color: var(--muted); font-weight: 600; }

/* Astra: replika struk asli */
.op-block.astra .op-head { background: linear-gradient(180deg, #ee6210, #e04e07); color: #fff; }
.op-block.astra .op-sum { color: #ffe3cf; }
.astra-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; padding: 18px; background: #faf8f6; }
.astra-struk {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px;
  font-family: Arial, Helvetica, sans-serif; font-size: 13px; color: #3a3a3a; background: #fff; line-height: 1.6;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.05);
}
.astra-struk hr { border: none; border-top: 1px solid #e3ddd6; margin: 10px 0; }
/* watermark miring ala struk asli */
.ar-wm {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: rgba(230,81,0,0.06);
  transform: rotate(-20deg); pointer-events: none; letter-spacing: 0.05em; z-index: 0;
}
.astra-struk > *:not(.ar-wm) { position: relative; z-index: 1; }
.ar-logo { text-align: center; margin-bottom: 2px; }
.ar-logo img { height: 28px; width: auto; }
.ar-ruas { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: #4a4a4a; margin-top: -4px; }
.ar-call { text-align: center; font-size: 11px; color: #888; margin-top: 3px; }
.ar-gerbang { font-weight: 400; font-size: 15px; color: #333; }
.ar-when { font-size: 13px; color: #555; margin: 3px 0; }
.ar-gol { font-size: 13px; color: #555; }
.ar-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ar-row span:first-child { color: #555; }
.ar-row span:last-child { color: #333; }
.ar-msg { text-align: center; font-size: 13px; color: #555; line-height: 1.7; }
.astra-total { text-align: right; padding: 16px 22px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; border-top: 1px solid var(--line); }

/* Serbaraja: replika struk asli */
.op-block.serbaraja .op-head { background: linear-gradient(180deg, #223179, #1b2a66); color: #fff; }
.op-block.serbaraja .op-sum { color: #c3ccf0; }
.sb-receipt { padding: 20px; overflow-x: auto; }
.sb-logo { font-weight: 800; font-size: 20px; color: #c0366f; letter-spacing: -0.01em; margin-bottom: 14px; }
.sb-meta { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 16px; font-size: 18px; font-weight: 800; }
.sb-meta strong { display: block; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; margin-bottom: 2px; }
.sb-meta .bal { color: var(--ok); }
.sb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sb-table thead th { background: var(--sb-blue); color: #fff; padding: 10px 12px; text-align: left; font-weight: 600; white-space: nowrap; font-size: 11px; letter-spacing: 0.03em; }
.sb-table tbody td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sb-table .gol { background: var(--orange-soft); color: var(--orange); font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.sb-table .bal { color: var(--ok); font-weight: 700; }
.sb-note { padding: 12px 2px 0; font-size: 12px; color: var(--muted); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.55); }
.foot-in { max-width: 1040px; margin: 0 auto; padding: 26px 20px 44px; color: var(--muted); font-size: 12.5px; }
.foot-in p { margin: 0 0 6px; max-width: 70ch; }
.ops { font-size: 11.5px; opacity: 0.85; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  main { padding-top: 32px; }
  .top { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 460px) {
  .head-note { display: none; }
  .hero h1 { font-size: 30px; }
  .lead { font-size: 16px; }
  .card { padding: 20px; }
  .row { grid-template-columns: 1fr; }
  .astra-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* print / PDF — tampil persis seperti struk operator asli */
@media print {
  .site-head, .hero, #form, #status, .site-foot, .toolbar, .btn-dl, .op-head.print-hide, .op-head { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: 100%; }
  .results { margin: 0; gap: 20px; }
  .op-block { border: none; box-shadow: none; break-inside: avoid; animation: none; }
  .astra-grid { background: #fff; }
  .astra-struk { border: 1px solid #ddd; box-shadow: none; break-inside: avoid; }
  .sb-table tr { break-inside: avoid; }
  .astra-total { border-top: 2px solid #000; }
}
