/* CHORDAL account portal — the default Signal Records look (BRAND-STYLE-GUIDE.md §1–9):
   flat #595959 page, #ffed68 text, #000 panels (35 px radius), ADLaM Display everywhere,
   #e0d15e for yellow surfaces, #555 control borders, disabled = opacity .4, hover = brightness(1.1),
   no shadows, no gradients. One deliberate web difference: a visible keyboard focus (:focus-visible,
   in the input-focus yellow) instead of the app's suppressed focus rings (guide §6.10 leaves it open). */

@font-face {
  font-family: "ADLaM Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ADLaM-Display-Regular.ttf") format("truetype");
}

:root {
  --bg: #595959;
  --text: #ffed68;
  --surface-yellow: #e0d15e;
  --panel: #000000;
  --inset: #2a2a2a;
  --input: #1a1a1a;
  --row: #3a3a3a;
  --btn: #4a4a4a;
  --border-control: #555;
  --border-brand: #979797;
  --border-dialog: #666;
  --hairline: #444;
  --body: #d0d0d0;
  --muted: #999;
  --label: #ffffbb44;
  --red: #f06e6e;
  --green: #7dcc7d;
  --dark-text: #303030;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "ADLaM Display", sans-serif;
  font-size: 19px;
  line-height: 1.3;
}

body { padding: 20px 16px 55px; }

.brand { text-align: center; margin: 10px auto 30px; width: fit-content; }
.brand .logo-image { display: block; height: 60px; width: auto; }

h1, h2 { font-weight: 400; margin: 0 0 12px; }
h1 { font-size: 1.1rem; text-align: center; }
h2 { font-size: 1em; color: var(--body); }

.panel {
  background: var(--panel);
  border-radius: 35px;
  padding: 20px 25px;
}
main.narrow { max-width: 430px; margin: 0 auto; }
main.wide { max-width: 640px; margin: 0 auto; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.spread { justify-content: space-between; }
.row.center { justify-content: center; gap: 18px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.body { font-size: 13px; color: var(--body); line-height: 1.4; margin: 0; }
.muted { font-size: 12px; color: var(--muted); margin: 0; }
.note { font-size: 11px; color: var(--muted); margin: 12px 0 0; line-height: 1.4; }
.accent { color: var(--surface-yellow); }
.error { font-size: 13px; color: var(--red); text-align: center; margin: 0; line-height: 1.4; }
#notice { padding: 0 25px; }
[hidden] { display: none !important; }

.field {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-control);
  background: var(--input);
  color: var(--surface-yellow);
  font: inherit;
  font-size: 15px;
  text-align: center;
}
.field::placeholder { color: #666; }
.field:focus { outline: none; border-color: var(--surface-yellow); }
.field.code { letter-spacing: 0.3em; }
.field.device-code { font-size: 12px; font-variant-numeric: tabular-nums; }

button, .btn { font-family: inherit; cursor: pointer; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 5px;
  font-size: 16px;
  text-decoration: none;
  transition: filter 0.1s;
}
.btn.primary { background: var(--surface-yellow); border: 1px solid var(--surface-yellow); color: var(--dark-text); }
form .btn.primary { width: 100%; }
.btn.secondary { background: var(--btn); border: 1px solid var(--border-dialog); color: var(--text); font-size: 0.85rem; padding: 8px 16px; border-radius: 4px; }
.btn.danger { background: var(--red); border: 1px solid var(--red); color: var(--dark-text); }
.btn.small { padding: 2px 8px; font-size: 12px; border-radius: 4px; }
.btn:hover { filter: brightness(1.1); }
.btn:active { filter: brightness(1.4); }
.btn .version { font-size: 12px; opacity: 0.8; }

.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
}
.link:hover { filter: brightness(1.1); }

button:disabled { opacity: 0.4; cursor: default; }
:focus-visible { outline: 2px solid var(--surface-yellow); outline-offset: 2px; }
.field:focus-visible { outline: none; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card {
  background: var(--inset);
  border: 1px solid var(--border-control);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.serial { font-size: 15px; color: var(--text); user-select: all; letter-spacing: 0.03em; }
.status { font-size: 12px; padding: 1px 8px; border-radius: 3px; border: 1px solid currentColor; }
.status.ok { color: var(--green); }
.status.bad { color: var(--red); }

.group + .group { margin-top: 12px; }
.devices {
  background: var(--inset);
  border: 1px solid var(--border-control);
  border-radius: 6px;
  padding: 8px 10px;
  gap: 4px;
}
.device { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--body); min-height: 24px; }
.device.removed .label { opacity: 0.6; }
.actions { display: inline-flex; align-items: center; gap: 8px; }
.confirm { display: inline-flex; align-items: center; gap: 8px; }

.who { padding: 14px 25px; }

/* referrals (design §21) */
.label-line { font-size: 12px; color: var(--muted); }
.grow-field { flex: 1; min-width: 200px; width: auto; text-align: left; }
.narrow-field { width: auto; }
.totals { gap: 12px; margin: 14px 0; }
.total { flex: 1; min-width: 90px; background: var(--inset); border: 1px solid var(--border-control); border-radius: 6px; padding: 8px 10px; }
.total .amount { font-size: 17px; color: var(--text); }
.ref-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--body); min-height: 24px; flex-wrap: wrap; }
.ref-row .amount { color: var(--text); font-variant-numeric: tabular-nums; }
.ref-date { min-width: 80px; }
.ref-status { font-size: 12px; }
.ref-status.pending { color: var(--muted); }
.ref-status.payable, .ref-status.paid, .ref-status.credit { color: var(--green); }
.ref-status.clawback { color: var(--red); }
.ref-status.void { color: var(--muted); font-style: italic; }

@media (max-width: 480px) {
  body { padding: 12px 16px 40px; }
  .panel { padding: 18px 16px; border-radius: 12px; }
  .device { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
