/*
 * pay.thispostable.app. Tokens and component shapes copied from
 * https://dev.thispostable.app/css/style.css (see ../../DESIGN.md).
 * Square corners, no blur, no gradients. Depth is a printed 4px offset.
 *
 * Design Read: checkout page for Indonesian users who already use the app,
 * in the site's square, hard-shadow language, dial ENERGY 1 / RHYTHM 2 / MOTION 1.
 * Reasons, one line each:
 *  - Maven Pro / Plus Jakarta Sans: the Flutter theme's own faces, so web and app match.
 *  - Orange only on the amount in the pay panel and the focus ring: the one key moment.
 *  - Yellow only in the logo mark and the 4px underline under the current nav item.
 *  - Hard shadow 10px only on the pay panel (the one focal surface); 4px on the selected plan and buttons.
 *  - Focusable surfaces stay white: orange on #f4f5f6 is 2.98:1, under the 3:1 non-text bar.
 */

:root {
  --bg: #ffffff;
  --card: #f4f5f6;
  --rule: #cfd8dc;
  --display: #263238;
  --headline: #546e7a;
  --body: #616161;
  --label: #78909c;
  --primary: #000000;
  --on-primary: #ffffff;
  --disabled-bg: rgba(0, 0, 0, 0.12);
  --disabled-fg: rgba(0, 0, 0, 0.5);
  --field: #212121;
  --orange: #ff512c;
  --yellow: #ffe600;
  --font-body: "Maven Pro", system-ui, sans-serif;
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --hard-shadow: color-mix(in srgb, var(--primary) 10%, transparent);
  --gutter: 24px;
  --max: 1320px;
  --gap: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 400 16px/1.5 var(--font-body);
  letter-spacing: -0.1px;
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
a, button, label, summary, input[type="radio"] { cursor: pointer; }
[aria-disabled="true"], :disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
p { margin: 0; text-wrap: pretty; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.main { flex: 1; padding-block: 32px 72px; }

h1, h2, h3 {
  margin: 0;
  color: var(--display);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}
h1 { font-size: clamp(32px, 5vw, 56px); letter-spacing: -0.03em; line-height: 1.08; }
h2 { font-size: clamp(22px, 2.4vw, 28px); }
h3 { font-size: 20px; }
.lede { max-width: 52ch; margin-top: 16px; font-size: 18px; }
.small { font-size: 13px; color: var(--headline); }

/* ---------- Buttons (style.css .btn) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  padding: 0.85em 1.1em;
  border: 1px solid transparent;
  background: transparent;
  color: var(--primary);
  font: 500 12px/1.2 var(--font-body);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  transition: none;
}
.btn--lg { font-size: 14px; }
.btn--primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); box-shadow: 4px 4px 0 var(--hard-shadow); }
.btn--primary:hover { background: var(--bg); color: var(--primary); }
.btn--primary:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--hard-shadow); }
.btn--ghost { border-color: var(--primary); }
.btn--ghost:hover { background: var(--primary); color: var(--on-primary); }
.btn--ghost:active { background: var(--bg); color: var(--primary); }
.btn--text:hover { background: var(--primary); color: var(--on-primary); }
.btn--text:active { background: var(--bg); color: var(--primary); }
.btn--price { text-transform: none; letter-spacing: 0.5px; width: 100%; font-size: 16px; font-weight: 600; }
.btn[aria-disabled="true"], .btn:disabled {
  background: var(--disabled-bg); border-color: transparent; color: var(--disabled-fg);
  box-shadow: none; transform: none;
}
.btn[aria-disabled="true"] { pointer-events: none; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--rule); }
.bar { display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px;
  color: var(--display); font: 600 18px/1 var(--font-display);
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
}
/* Logo mark: the two brand squares, drawn in CSS because no logo file was supplied. [LOGO] */
.mark { display: inline-flex; width: 32px; height: 32px; }
.mark i { flex: 1; }
.mark i:first-child { background: var(--orange); }
.mark i:last-child { background: var(--yellow); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav .btn { box-shadow: none; }
.nav .btn[aria-current="page"] { box-shadow: inset 0 -4px 0 var(--yellow); background: var(--card); }
.nav .btn[aria-current="page"]:hover { background: var(--primary); }
.account { display: flex; align-items: center; gap: 8px; min-width: 0; }
.account__email { color: var(--display); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
@media (max-width: 720px) {
  .bar { padding-block: 4px; row-gap: 0; }
  .account { order: 3; width: 100%; padding-bottom: 8px; justify-content: space-between; }
  .account__email { max-width: none; flex: 1; }
}

.offline { padding: 12px var(--gutter); background: var(--primary); color: var(--on-primary); font-weight: 500; text-align: center; }

/* ---------- Page grid ---------- */
.main > .lede + * { margin-top: 32px; }
.main > h1 + .signin { margin-top: 24px; }
.layout { display: grid; gap: 40px; margin-top: 32px; }
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 48px; }
  .layout .usage { grid-column: 1 / -1; }
  .layout .pay { position: sticky; top: 88px; }
}

/* ---------- Panels ---------- */
.panel { padding: 24px; border: 1px solid var(--field); background: var(--bg); }
.panel > * + * { margin-top: 12px; }
.panel h2 { font-size: 22px; }
.signin { max-width: 520px; box-shadow: 4px 4px 0 var(--hard-shadow); }
.signin .btn { margin-top: 20px; }
.msg { color: var(--display); font-weight: 500; }
.msg:empty { display: none; }

/* State blocks: loading, empty, error. Each says what happened and what to do. */
.state { padding: 24px; border: 1px solid var(--rule); background: var(--card); color: var(--display); }
.state > * + * { margin-top: 12px; }
.state strong { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.state .btn { margin-top: 16px; background: var(--bg); }
.state--loading { border-style: dashed; }

/* ---------- Usage ---------- */
.usage h2 { margin-bottom: 16px; }
.usage__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; color: var(--display); }
.usage__plan { font: 600 20px/1.2 var(--font-display); }
meter { display: block; width: 100%; max-width: 520px; height: 12px; margin-top: 12px; appearance: none; border: 1px solid var(--field); background: var(--bg); }
meter::-webkit-meter-bar { background: var(--bg); border: 0; height: 10px; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value { background: var(--primary); }
meter::-moz-meter-bar { background: var(--primary); }

/* ---------- Plans ---------- */
.plans h2 { margin-bottom: 8px; }
.plans__hint { margin-bottom: 8px; color: var(--display); }
.tier { margin: 24px 0 0; padding: 0; border: 0; min-width: 0; }
.tier legend { padding: 0; margin-bottom: 12px; color: var(--display); font: 600 20px/1.2 var(--font-display); }
.tier legend span { color: var(--headline); font: 500 14px var(--font-body); margin-left: 8px; }
.period-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.plan {
  position: relative; display: block; padding: 16px 16px 16px 48px;
  border: 1px solid var(--field); background: var(--bg); color: var(--body);
}
.plan input { position: absolute; left: 16px; top: 18px; width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.plan:hover { background: var(--card); }
.plan:has(input:checked) { background: var(--card); box-shadow: 4px 4px 0 var(--hard-shadow); outline: 2px solid var(--primary); outline-offset: -2px; }
.plan:has(input:focus-visible) { outline: 2px solid var(--orange); outline-offset: 2px; }
.plan:has(input:disabled) { background: var(--bg); border-color: var(--rule); cursor: not-allowed; }
/* The reason a plan is disabled must stay readable (6.2:1); only the numbers dim. */
.plan:has(input:disabled) .plan__days, .plan:has(input:disabled) .plan__price { color: var(--disabled-fg); }
.plan:has(input:disabled) input { cursor: not-allowed; }
.plan__days { display: block; color: var(--display); font: 600 22px/1.2 var(--font-display); }
.plan__price { display: block; margin-top: 2px; color: var(--display); font: 600 18px/1.3 var(--font-body); font-variant-numeric: tabular-nums; }
.plan__name { display: block; margin-top: 2px; font-size: 13px; color: var(--headline); }
.plan__rule { display: block; margin-top: 10px; font-size: 14px; line-height: 1.4; }

/* ---------- Pay panel: the one focal surface per screen ---------- */
.pay .panel { box-shadow: 10px 10px 0 var(--hard-shadow); }
.pay__plan { color: var(--display); font: 600 18px/1.3 var(--font-display); }
.pay__amount { color: var(--orange); font: 700 40px/1.1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pay__rule { color: var(--display); }
.pay__refund { padding-top: 12px; border-top: 1px solid var(--rule); color: var(--display); font-size: 14px; }
.pay .btn--price { margin-top: 16px; }
.pay__empty { color: var(--display); }
.pay__was { margin: 0; color: var(--display); font-size: 14px; font-variant-numeric: tabular-nums; }
.promo { margin-top: 16px; }
.promo__label { display: block; margin-bottom: 4px; color: var(--display); font-size: 14px; font-weight: 600; }
.promo__row { display: flex; gap: 8px; }
.promo__row .field { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--field); border-radius: 0; background: var(--bg); color: var(--display); font: inherit; text-transform: uppercase; }
.promo__row .field:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.promo__row .btn { margin-top: 0; }
.promo .msg { margin-top: 6px; min-height: 1.4em; font-size: 14px; }

/* ---------- Status (return page) ---------- */
.status { max-width: 640px; box-shadow: 10px 10px 0 var(--hard-shadow); }
.status h2 { font-size: 28px; }
.status .btn-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 20px; }
.status .btn-row .btn { margin-top: 0; }
.status__meta { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; color: var(--display); }
.status__meta dt { color: var(--headline); }
.status__meta dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- History ---------- */
.hist { margin-top: 40px; }
.hist h2 { margin-bottom: 16px; }
.tbl { width: 100%; border-collapse: collapse; color: var(--display); font-variant-numeric: tabular-nums; }
.tbl th { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--field); color: var(--headline); font-weight: 600; font-size: 14px; text-align: left; }
.tbl td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.sq { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 1px solid var(--primary); background: var(--primary); }
.sq--open { background: var(--bg); }
.sq--fail { background: var(--orange); border-color: var(--orange); }
.hist .btn { margin-top: 16px; }
@media (max-width: 639px) {
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl tr { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .tbl td { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; padding: 2px 0; border: 0; }
  .tbl td::before { content: attr(data-label); color: var(--headline); }
}

.site-footer { padding-block: 24px; background: var(--card); }

@media (max-width: 600px) { :root { --gutter: 16px; --gap: 8px; } .panel { padding: 16px; } .pay__amount { font-size: 34px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
