/* ZitStack account portal — GraceCut's own design language.
   The same dark surfaces and single amber accent as the product site and the
   app, spent the same way: the one primary action, and nothing else. Dark-only
   by intent — that is the brand, not a theme preference.
   Variable NAMES are load-bearing: admin.html's inline styles reference
   --line, --ink-soft and --danger, so rename nothing, only revalue. */

:root {
  --bg: #0E1116;
  --card: #171B22;
  --inset: #10141A;
  --raised: #1E242E;
  --ink: #F4F4F4;
  --ink-soft: #A8B0BB;
  --muted: #727C89;
  --line: #262B35;
  --accent: #F4B400;
  --accent-hover: #FFC426;
  --accent-ink: #16130A;
  --danger: #FCA5A5;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --info: #6EE7B7;
  --info-bg: rgba(16, 185, 129, 0.15);
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* The signed-in and signed-out cards are toggled with the `hidden` attribute,
   and `.card { display:flex }` below would silently defeat it — author CSS
   outranks the UA rule for [hidden], which is exactly how both cards once
   rendered at the same time. This rule keeps `hidden` meaning hidden. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.shell { width: 100%; max-width: 460px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.brand h1 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.brand.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.muted { color: var(--ink-soft); margin: 2px 0 0; }
.small { font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--ink-soft); }

input {
  font: inherit;
  color: var(--ink);
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}

input::placeholder { color: var(--muted); }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.btn {
  font: inherit;
  font-weight: 550;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--raised);
  color: var(--ink);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.btn:hover { border-color: #333A46; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.small { padding: 7px 11px; font-size: 13px; }

.linkish {
  background: none;
  border: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.linkish:hover { color: var(--ink); }

/* Hidden until there is something to say, so the card never reserves a gap for
   a message that has not happened. */
.notice { margin: 0; font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 8px; }
.notice.error { color: var(--danger); background: var(--danger-bg); }
.notice.info { color: var(--info); background: var(--info-bg); }

.balance { display: flex; align-items: baseline; gap: 8px; }
.figure { font-size: 34px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* Empty is worth noticing, but it is not an error — the editor is unaffected. */
.balance .figure:empty::before { content: "—"; }

.section {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 8px 0 0;
}

.products { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.products li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* The product whose subdomain you are on — the one place amber marks state. */
.products li.current { border-color: rgba(244, 180, 0, 0.45); }
.pname { font-weight: 550; }

/* Credit packs. Buttons, not cards with a buy link — the whole tile is the
   action. Amber stays reserved for the price, the thing being decided on. */
#topupSection { display: flex; flex-direction: column; gap: 10px; }
.packs { display: flex; flex-direction: column; gap: 8px; }

.pack {
  font: inherit;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "credits price" "blurb price";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  text-align: left;
  padding: 12px 14px;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.pack:hover { border-color: rgba(244, 180, 0, 0.45); background: var(--raised); }
.pack .pcredits { grid-area: credits; font-weight: 550; }
.pack .muted { grid-area: blurb; margin: 0; }
.pack .pprice {
  grid-area: price;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.footer { text-align: center; margin-top: 16px; color: var(--muted); }
.footer a { color: var(--ink-soft); text-decoration: none; }
.footer a:hover { color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Two short fields sharing a line (city/country). */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Registration details block inherits the card's gap through its own. */
#signupFields { display: flex; flex-direction: column; gap: 14px; }
#signupFields[hidden] { display: none !important; }

/* Usage history: what changed a balance, newest first. */
.usage { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.usage li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}

/* Sign Out sits beside the Admin link when there is one. */
.head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.head-actions .btn { text-decoration: none; display: inline-flex; align-items: center; }
