/* Inter, self-hosted (SIL OFL 1.1, see fonts/Inter-OFL.txt): public pages must not depend on Google Fonts,
   isolated customers can only reach this server. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter-latin-700-normal.woff2') format('woff2'); }

/* TR Inet Panel: public pages (landing page and bill pages, no login).
   Tokens come from :root in tr-inet.css, which is loaded first. Every rule is scoped to body.tp. */

/* ---------- base ---------- */
body.tp {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--ground);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
  -webkit-text-size-adjust: 100%;
}
.tp *, .tp *::before, .tp *::after { box-sizing: border-box; }
.tp h1, .tp h2, .tp h3, .tp p { margin: 0; }
.tp h1, .tp h2, .tp h3 { font-weight: 650; letter-spacing: -.015em; text-wrap: balance; }
.tp p { text-wrap: pretty; }
.tp a { color: var(--blue); text-decoration: none; }
.tp a:hover { color: var(--blue-d); }
.tp ::selection { background: var(--blue-r); color: var(--ink); }
.tp :focus { outline: none; }
.tp :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.tp .tnum, .tp table { font-variant-numeric: tabular-nums; }
.tp svg.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tp .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.tp-wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; }
.tp-landing .tp-wrap { max-width: 1080px; }

/* ---------- header ---------- */
.tp-top { background: #fff; border-bottom: 1px solid var(--line); }
.tp-top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.tp-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; font-size: 16px; font-weight: 650; letter-spacing: -.01em; color: var(--ink) !important; }
.tp-brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-brand img { display: block; height: 32px; width: auto; max-width: 200px; object-fit: contain; }
.tp-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; }
.tp-top-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink2) !important; white-space: nowrap; }
.tp-top-link:hover { background: var(--ground); color: var(--ink) !important; }

/* ---------- page body ---------- */
.tp-main { flex: 1 0 auto; padding: 24px 0 40px; }
.tp-stack { display: flex; flex-direction: column; gap: 16px; }
.tp-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.tp-card-b { padding: 20px; }
.tp-card-h { padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.tp-title { font-size: 22px; line-height: 1.25; }
.tp-sub { margin-top: 4px; font-size: 14.5px; color: var(--ink3); }
.tp-sub b { color: var(--ink2); font-weight: 600; }
.tp-back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; font-size: 14.5px; font-weight: 500; color: var(--ink2) !important; }
.tp-back:hover { color: var(--ink) !important; }

/* ---------- buttons and fields ---------- */
.tp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink) !important; font: inherit; font-size: 15.5px; font-weight: 600; line-height: 1.2;
  cursor: pointer; text-align: center; transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.tp-btn:hover { background: var(--soft); border-color: #cbd5e1; }
.tp-btn:active { transform: translateY(1px); }
.tp-btn-pri { background: var(--blue); border-color: var(--blue); color: #fff !important; box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }
.tp-btn-pri:hover { background: var(--blue-d); border-color: var(--blue-d); }
.tp-btn-block { width: 100%; }
.tp-btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.tp-btn[disabled] { opacity: .55; cursor: default; }

.tp-field { display: flex; flex-direction: column; gap: 6px; }
.tp-field label { font-size: 14.5px; font-weight: 600; color: var(--ink2); }
.tp-input {
  width: 100%; min-height: 52px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; font-size: 18px; font-weight: 600; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s;
}
.tp-input::placeholder { color: #94a3b8; font-weight: 500; }
.tp-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-r); }
.tp-input[aria-invalid="true"] { border-color: var(--red); }
.tp-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--red-s); }
.tp-help { font-size: 14px; color: var(--ink3); }
.tp-error { font-size: 14px; color: var(--red); font-weight: 500; }

/* ---------- notices ---------- */
.tp-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); font-size: 14.5px; color: var(--ink2); }
.tp-note svg.ic { margin-top: 2px; color: var(--ink3); }
.tp-note b { color: var(--ink); }
.tp-note.is-warn { background: var(--amber-s); border-color: #fde68a; color: #78350f; }
.tp-note.is-warn svg.ic { color: var(--amber); }
.tp-note.is-ok { background: var(--green-s); border-color: #bbf7d0; color: #14532d; }
.tp-note.is-ok svg.ic { color: var(--green); }
.tp-note.is-bad { background: var(--red-s); border-color: #fecaca; color: #7f1d1d; }
.tp-note.is-bad svg.ic { color: var(--red); }

.tp-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--ground); color: var(--ink2); }
.tp-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tp-pill.is-ok { background: var(--green-s); color: var(--green); }
.tp-pill.is-bad { background: var(--red-s); color: var(--red); }
.tp-pill.is-warn { background: var(--amber-s); color: var(--amber); }

/* ---------- lookup form ---------- */
.tp-lookup { max-width: 460px; margin: 0 auto; }
.tp-lookup .tp-card-b { display: flex; flex-direction: column; gap: 18px; padding: 24px 20px; }
.tp-lookup-foot { font-size: 14.5px; color: var(--ink3); text-align: center; }

/* ---------- bills list ---------- */
.tp-due { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--amber-s); }
.tp-due p { font-size: 15px; color: #78350f; }
.tp-due b { color: var(--ink); }
.tp-bills { width: 100%; border-collapse: collapse; }
.tp-bills th { height: 40px; padding: 0 12px; text-align: left; font-size: 13px; font-weight: 500; color: var(--ink3); background: var(--soft); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tp-bills td { padding: 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; font-size: 15px; }
.tp-bills tr:last-child td { border-bottom: 0; }
.tp-bills th:first-child, .tp-bills td:first-child { padding-left: 20px; }
.tp-bills th:last-child, .tp-bills td:last-child { padding-right: 20px; text-align: right; }
.tp-bills .tp-per { font-weight: 600; color: var(--ink); }
.tp-bills .tp-amt { white-space: nowrap; font-weight: 600; }
.tp-bills a.tp-open { display: inline-flex; align-items: center; min-height: 40px; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.tp-bills tr.is-open td { background: var(--amber-s); }
.tp-empty { padding: 32px 20px; text-align: center; }
.tp-empty h2 { font-size: 17px; }
.tp-empty p { margin-top: 6px; font-size: 14.5px; color: var(--ink3); }

/* ---------- invoice ---------- */
.tp-amount { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-bottom: 1px solid var(--line); }
.tp-amount-k { font-size: 14px; font-weight: 500; color: var(--ink3); }
.tp-amount-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tp-amount-v { font-size: clamp(30px, 9vw, 40px); line-height: 1.1; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; color: var(--ink); }
.tp-copy.is-done { border-color: #bbf7d0; background: var(--green-s); color: var(--green) !important; }

.tp-qris { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; border-bottom: 1px solid var(--line); text-align: center; }
.tp-qris-img { display: block; width: 100%; max-width: 320px; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.tp-qris-name { font-size: 15px; font-weight: 600; }
.tp-qris-help { font-size: 14px; color: var(--ink3); max-width: 40ch; }
.tp-qris-note { font-size: 14px; color: var(--ink2); max-width: 52ch; white-space: pre-line; }

.tp-list { margin: 0; padding: 0; list-style: none; }
.tp-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line2); font-size: 15px; }
.tp-list li:last-child { border-bottom: 0; }
.tp-list li > span:first-child { color: var(--ink2); min-width: 0; overflow-wrap: anywhere; }
.tp-list li > span:last-child { font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tp-list li.is-total { border-top: 1px solid var(--line); border-bottom: 0; margin-top: 2px; padding-top: 12px; }
.tp-list li.is-total > span { color: var(--ink); font-weight: 700; }
.tp-sec { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.tp-sec:last-child { border-bottom: 0; }
.tp-sec h2 { font-size: 15px; margin-bottom: 4px; }
.tp-sec .tp-list + .tp-note { margin-top: 8px; }
.tp-paid { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.tp-paid form { margin: 0; }

.tp-receipt-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tp-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- landing ---------- */
.tp-hero { flex: 1 0 auto; display: flex; align-items: center; padding: 40px 0 56px; }
.tp-hero-in { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.tp-hero h1 { font-size: clamp(32px, 8.5vw, 52px); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; max-width: 14ch; }
.tp-hero h1 span { color: var(--blue); }
.tp-lead { margin-top: 16px; font-size: 17px; line-height: 1.6; color: var(--ink2); max-width: 46ch; }
.tp-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.tp-cta .tp-btn { min-height: 52px; font-size: 16px; }
.tp-cta .tp-btn svg.ic { width: 20px; height: 20px; }
.tp-art { position: relative; width: 100%; max-width: 240px; margin: 0 auto; aspect-ratio: 1; }
.tp-art svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tp-art .bg { fill: var(--blue-s); stroke: var(--blue-r); }
.tp-art .arc { fill: none; stroke-linecap: round; stroke-width: 22px; }
.tp-art .a3 { stroke: var(--blue-r); }
.tp-art .a2 { stroke: var(--blue); stroke-opacity: .5; }
.tp-art .a1 { stroke: var(--blue); }
.tp-art .dot { fill: var(--blue-d); }
@media (prefers-reduced-motion: no-preference) {
  .tp-art .arc, .tp-art .dot { opacity: 0; animation: tp-arc .9s var(--ease) forwards; }
  .tp-art .dot { animation-delay: .05s; }
  .tp-art .a1 { animation-delay: .2s; }
  .tp-art .a2 { animation-delay: .35s; }
  .tp-art .a3 { animation-delay: .5s; }
}
@keyframes tp-arc { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- footer ---------- */
.tp-foot { flex: none; border-top: 1px solid var(--line); background: #fff; }
.tp-foot-in { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; padding-bottom: 18px; font-size: 13.5px; color: var(--ink3); }
.tp-foot-in b { color: var(--ink2); font-weight: 600; }
.tp-foot-in a { color: var(--ink3) !important; }
.tp-foot-in a:hover { color: var(--blue) !important; }
.tp-foot-contact { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  .tp-main { padding: 40px 0 56px; }
  .tp-wrap { padding: 0 24px; }
  .tp-card-b, .tp-amount, .tp-qris, .tp-paid { padding: 24px; }
  .tp-card-h { padding: 24px 24px 18px; }
  .tp-title { font-size: 24px; }
  .tp-due { flex-direction: row; align-items: center; justify-content: space-between; padding: 16px 24px; }
  .tp-sec { padding: 18px 24px; }
  .tp-bills th:first-child, .tp-bills td:first-child { padding-left: 24px; }
  .tp-bills th:last-child, .tp-bills td:last-child { padding-right: 24px; }
  .tp-cta { flex-direction: row; }
  .tp-foot-in { flex-direction: row; align-items: center; justify-content: space-between; }
}
@media (min-width: 900px) {
  .tp-hero { padding: 64px 0 88px; }
  .tp-hero-in { grid-template-columns: 1.1fr .9fr; gap: 48px; }
  .tp-art { max-width: 420px; }
  .tp-lead { font-size: 18px; }
}

/* ---------- narrow phones: bill rows become two lines ---------- */
@media (max-width: 479px) {
  .tp-bills thead { display: none; }
  .tp-bills, .tp-bills tbody { display: block; }
  .tp-bills tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line2); }
  .tp-bills tr:last-child { border-bottom: 0; }
  .tp-bills tr.is-open { background: var(--amber-s); }
  .tp-bills td, .tp-bills td:first-child, .tp-bills td:last-child { display: block; padding: 0; border: 0; background: none !important; text-align: left; }
  .tp-bills td.c-amt, .tp-bills td.c-open { text-align: right; }
  .tp-bills td.c-open { grid-column: 2; align-self: center; }
  .tp-bills td.c-per { grid-column: 1; }
  .tp-bills td.c-amt { grid-column: 1; text-align: left; color: var(--ink2); }
  .tp-bills td.c-st { grid-column: 1; }
  .tp-bills td.c-open { grid-row: 1 / span 3; }
}

/* ---------- print (receipt) ---------- */
@media print {
  body.tp { background: #fff; }
  .tp-top, .tp-foot, .tp-noprint, .tp-back { display: none !important; }
  .tp-main { padding: 0; }
  .tp-card { box-shadow: none; border-color: #cbd5e1; }
  .tp-wrap { max-width: none; padding: 0; }
}

/* isolation page: two lead paragraphs, ID kept on one line */
.tp-hero-copy .tp-lead + .tp-lead { margin-top: 12px; }
.tp-nowrap { white-space: nowrap; }
