/* Gainserver customer portal (/user, /pay) — bright, simple, brand colours */
:root {
  --navy: #0B1220; --text: #0B1220; --text-2: #475569; --text-3: #64748B;
  --bg: #F8F7F3; --surface: #FFFFFF; --border: #E5E7EB; --border-2: #CBD5E1;
  --emerald: #10B981; --emerald-d: #047857; --emerald-l: #D1FAE5; --cyan: #06B6D4; --amber: #F59E0B; --amber-l: #FEF3C7; --red: #DC2626;
  --radius: 20px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  font: 15.5px/1.6 "Plus Jakarta Sans", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: #0E7490; text-underline-offset: 3px; }
h1, h2 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .94em; }
.small { font-size: 13px; }
.r { text-align: right; }

.pt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px max(16px, calc((100% - 1080px) / 2)); }
.pt-logo img { display: block; height: 38px; width: auto; }
.pt-logout { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--text-2); min-width: 0; }
.pt-logout span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.pt-logout button { font: inherit; font-weight: 700; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; }
.pt-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 12px 16px 56px; }
.pt-foot { padding: 22px 16px 28px; text-align: center; font-size: 12.5px; color: var(--text-3); }
.pt-foot a { color: var(--text-3); }

.pt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: 0 1px 2px rgba(11,18,32,.04); }
.pt-narrow { max-width: 460px; margin: 6vh auto 0; }
.pt-label { display: block; font-family: "JetBrains Mono", monospace; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.pt-muted { color: var(--text-2); margin: 10px 0 0; }
.pt-error { margin: 16px 0 0; padding: 11px 14px; border-radius: 12px; background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; font-size: 14px; }
.pt-note { margin: 0 0 14px; padding: 11px 14px; border-radius: 12px; background: var(--amber-l); color: #92400E; font-size: 13.5px; }

/* Login */
.pt-login h1 { font-size: clamp(28px, 6vw, 34px); font-weight: 800; }
.pt-login form { display: grid; gap: 8px; margin-top: 22px; }
.pt-login .pt-alert { margin: 16px 0 0; }
.pt-login label { font-weight: 700; font-size: 14px; }
.pt-login input { font: inherit; font-size: 16px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--border-2); background: #fff; color: var(--text); width: 100%; }
.pt-login input:focus { outline: 3px solid rgba(16,185,129,.25); border-color: var(--emerald); }
.pt-code { font-family: "JetBrains Mono", monospace !important; font-size: 28px !important; letter-spacing: .45em; text-align: center; }
.pt-btn { display: block; width: 100%; margin-top: 10px; padding: 15px 22px; border: 0; border-radius: 999px; background: var(--amber); color: var(--navy);
  font: inherit; font-weight: 800; font-size: 16px; text-align: center; text-decoration: none; cursor: pointer; box-shadow: 0 10px 24px -12px rgba(245,158,11,.9); transition: transform .15s, box-shadow .15s; }
.pt-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -12px rgba(245,158,11,.95); }
.pt-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.pt-btn.is-loading { display: flex; align-items: center; justify-content: center; gap: 10px; opacity: .85; pointer-events: none; cursor: progress; transform: none; }
.pt-spin { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: pt-spin .7s linear infinite; }
@keyframes pt-spin { to { transform: rotate(360deg); } }
.pt-busy-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: #F0FDF8; border: 1px solid #A7F3D0; color: #065F46; font-size: 13.5px; text-align: center; }
.pt-methods:has(input:disabled) .pt-method { cursor: progress; }

/* Hero (pay page) */
.pt-hero { display: flex; gap: 16px; align-items: flex-start; margin: 10px 0 22px; }
.pt-hero h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 800; letter-spacing: -0.035em; }
.pt-hero p { margin: 12px 0 0; color: var(--text-2); font-size: 17px; max-width: 520px; }
.pt-mark { background: linear-gradient(transparent 62%, rgba(16,185,129,.35) 62%, rgba(16,185,129,.35) 92%, transparent 92%); padding: 0 2px; }
.pt-check { flex-shrink: 0; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--emerald); color: #fff; font-size: 28px; font-weight: 800; box-shadow: 0 0 0 10px var(--emerald-l); margin: 4px 6px 0 4px; }

.pt-pay { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 24px; align-items: start; }
.pt-pay:not(:has(.pt-checkout)) { grid-template-columns: minmax(0, 760px); justify-content: center; }
.pt-pay-main { min-width: 0; }
.pt-checkout { position: sticky; top: 20px; }
.pt-checkout h2 { font-size: 19px; margin-bottom: 14px; }
.pt-methods { display: grid; gap: 10px; }
.pt-method { position: relative; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.pt-method:hover { border-color: var(--border-2); }
.pt-method:has(input:checked) { border-color: var(--emerald); background: #F0FDF8; box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.pt-method:has(input:focus-visible) { outline: 3px solid rgba(6,182,212,.45); outline-offset: 2px; }
.pt-method input { accent-color: var(--emerald); width: 20px; height: 20px; margin: 0; flex-shrink: 0; }
.pt-m-text { flex: 1; min-width: 0; }
.pt-method b { display: block; font-size: 15px; line-height: 1.3; }
.pt-method small { display: block; margin-top: 2px; color: var(--text-3); font-size: 13px; line-height: 1.35; }
/* every logo sits in the same 80×40 tile so the list reads as one column */
.pt-m-logo { flex-shrink: 0; display: grid; place-items: center; width: 80px; height: 40px; border-radius: 10px; background: #fff; border: 1px solid var(--border); }
.pt-m-logo img { display: block; width: 70px; height: 28px; object-fit: contain; }
.pt-sum { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 4px; padding-top: 14px; border-top: 1px dashed var(--border-2); }
.pt-sum b { font-size: 22px; }
.pt-secure { margin: 14px 0 0; font-size: 13px; color: var(--emerald-d); font-weight: 600; line-height: 1.45; text-align: center; text-wrap: balance; }
.pt-secure svg { display: inline-block; vertical-align: -3px; margin-right: 5px; }

/* Invoice block */
.pt-inv { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.pt-inv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pt-inv-top b { font-size: 18px; }
.pt-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.s-unpaid { background: var(--amber-l); color: #92400E; } .s-overdue { background: #FEE2E2; color: #991B1B; }
.s-paid { background: var(--emerald-l); color: #065F46; } .s-cancelled { background: #F1F5F9; color: var(--text-2); }
.pt-dates { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 16px 0 0; }
.pt-dates dt, .pt-service dt { font-size: 12px; color: var(--text-3); }
.pt-dates dd, .pt-service dd { margin: 2px 0 0; font-weight: 700; }
.pt-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; padding: 16px; border-radius: 14px; background: var(--bg); }
.pt-parties span:not(.pt-label) { display: block; font-size: 13.5px; color: var(--text-2); }
.pt-parties b { display: block; }
.pt-items { width: 100%; border-collapse: collapse; font-size: 14.5px; table-layout: auto; }
.pt-items th, .pt-items td { padding: 11px 0; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.pt-items td.r, .pt-items th.r { text-align: right; padding-left: 16px; white-space: nowrap; }
.pt-items thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; }
.pt-inv .pt-btn { margin-top: 18px; }

/* Dashboard */
.pt-due-list { display: grid; gap: 12px; }
.pt-due { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 22px; }
.pt-due-main { min-width: 0; }
.pt-due-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pt-due p { margin: 6px 0 4px; }
.pt-due-pay { flex-shrink: 0; display: grid; gap: 8px; justify-items: end; }
.pt-due-pay b { font-size: 20px; }
.pt-due-pay .pt-btn { margin: 0; width: auto; padding: 12px 22px; font-size: 15px; }
.pt-welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin: 14px 0 24px; }
.pt-welcome h1 { font-size: clamp(30px, 6vw, 42px); font-weight: 800; letter-spacing: -0.035em; }
.pt-stats { display: flex; gap: 12px; }
.pt-stats div { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 18px; min-width: 140px; }
.pt-stats span { display: block; font-size: 12.5px; color: var(--text-3); }
.pt-stats b { font-size: clamp(16px, 4.4vw, 20px); white-space: nowrap; }
.pt-service { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.pt-service h2 { font-size: 21px; }
.pt-service dl { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; }
.pt-h2 { font-size: 20px; margin: 30px 0 12px; }
.pt-empty p { margin: 0; color: var(--text-2); }
.pt-table { padding: 8px 20px; }
.pt-scroll { overflow-x: auto; }
.pt-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pt-table th, .pt-table td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; vertical-align: top; }
.pt-table tr:last-child td { border-bottom: 0; }
.pt-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.pt-table td.wrap { white-space: normal; min-width: 240px; color: var(--text-2); }
.pt-table td small { display: block; color: var(--text-3); font-size: 12px; margin-top: 3px; }
.pt-table .r { text-align: right; }

@media (max-width: 880px) {
  .pt-pay { grid-template-columns: 1fr; }
  .pt-checkout { position: static; }
}
@media (max-width: 560px) {
  .pt-card, .pt-inv { padding: 20px 18px; border-radius: 18px; }
  .pt-parties { grid-template-columns: 1fr; }
  .pt-sum b { font-size: 20px; }
  .pt-m-logo { width: 68px; height: 36px; } .pt-m-logo img { width: 58px; height: 24px; }
  .pt-secure { font-size: clamp(11px, 3.1vw, 12.5px); white-space: nowrap; letter-spacing: -0.01em; }
  .pt-secure svg { width: 14px; height: 14px; margin-right: 4px; }
  .pt-logo img { height: 32px; }
  .pt-logout span { display: none; }
  .pt-due { flex-direction: column; align-items: stretch; }
  .pt-due-pay { justify-items: stretch; }
  .pt-stats { width: 100%; } .pt-stats div { flex: 1; min-width: 0; }
  .pt-narrow { margin-top: 3vh; }
}
@media (prefers-reduced-motion: reduce) { .pt-btn { transition: none; } .pt-spin { animation-duration: 2s; } }

/* Method not available for this amount (e.g. QRIS above Rp 10 juta) */
.pt-method.is-off { cursor: not-allowed; background: #F8FAFC; border-style: dashed; }
.pt-method.is-off b, .pt-method.is-off .pt-m-logo { opacity: .45; }
.pt-method.is-off small { color: #B45309; }

/* Inline alert (payment errors) */
.pt-alert { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px;
   padding: 12px 14px; border-radius: 12px; background: #FFF7ED; border: 1px solid #FED7AA; }
.pt-alert p { margin: 0; font-size: 14px; line-height: 1.5; color: #9A3412; }
.pt-alert-ico { flex-shrink: 0; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: #EA580C; color: #fff; font-size: 13px; font-weight: 800; line-height: 1; }

/* Line items. Desktop: normal wrapping table. Mobile: each item stays on one line and the description
   slides sideways under a pinned amount column, so the amounts are always visible. */
.pt-items-wrap { position: relative; }
.pt-items-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; outline: none; }
.pt-items-scroll:focus-visible { box-shadow: 0 0 0 3px rgba(6,182,212,.35); border-radius: 8px; }
.pt-swipe { display: none; }
@media (max-width: 560px) {
  .pt-items td:first-child { white-space: nowrap; padding-right: 14px; }
  .pt-items td.r, .pt-items th.r { position: sticky; right: 0; z-index: 1; background: #fff; padding-left: 14px; box-shadow: -14px 0 12px -6px #fff; }
  .pt-items-wrap.has-overflow .pt-swipe { display: inline-flex; gap: 4px; align-items: center; position: static; margin: 8px 0 0; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--text-3); font-size: 12px; font-weight: 600; }
  .pt-swipe span { display: inline-block; animation: pt-nudge 1.4s ease-in-out infinite; }
  .pt-items-wrap.at-end .pt-swipe { opacity: .5; }
}
@keyframes pt-nudge { 50% { transform: translateX(3px); } }
.pt-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 14px; font-weight: 700; font-size: 17px; }
.pt-total b { font-size: 18px; }
@media (prefers-reduced-motion: reduce) { .pt-swipe span { animation: none; } }
