/*
 * DotaPrime sign-in pages, variant V1 "Popup panel": one Dota PopupPanel card on the main-menu vignette.
 * Served as /account/style.css under style-src 'self'; no fonts, images or URLs of any kind.
 *
 * The server cannot read the app's src/renderer/design/tokens.css, so the values are copied here and keep the token
 * names of the app (palette --c-* and --dota-*, semantic --bg, --panel, --btn-*, ...). When tokens.css changes one of
 * them, change it here too. Palette used:
 *   --c-black --c-white --c-clear --c-bg-glow --c-bg-mid --c-bg-edge --c-popup-from --c-popup-to --c-popup-border
 *   --c-line --c-title-shadow --c-well --c-accent --c-accent-soft --c-btn-from --c-btn-to --c-btn-hover-from
 *   --c-btn-hover-to --c-btn-border --c-btn-green-from --c-btn-green-to --c-btn-green-hover-from
 *   --c-btn-green-hover-to --c-btn-green-border --c-btn-text-shadow --c-entry-from --c-entry-to --c-tick-border-hover
 *   --c-tick-shadow --c-tick-on-from --c-tick-on-to --c-tick-glow --c-check-label-on --dota-light-grey
 *   --dota-lighter-grey --dota-lightest-grey --dota-loser-red --dota-new-section-green --dota-gold
 * Web-only departures from the app, for WCAG AA and phones:
 *   - field and tick-box border at rest is --c-tick-border-hover (#697879) instead of #444 and #5e686966, which are
 *     below 3:1 on the card;
 *   - controls are 44-60 px tall and field text is 16 px (no zoom on iOS);
 *   - the system font stack instead of Radiance and Reaver (Valve fonts are never served on the web).
 */
:root {
  /* Palette (tokens.css layer 1). */
  --c-black: #000;
  --c-white: #fff;
  --c-clear: rgba(0, 0, 0, 0);
  --c-bg-glow: #1c2730;
  --c-bg-mid: #0e1317;
  --c-bg-edge: #050607;
  --c-popup-from: rgba(39, 45, 46, 0.93);
  --c-popup-to: rgba(19, 22, 23, 0.93);
  --c-popup-border: #5e6869;
  --c-line: rgba(94, 104, 105, 0.35);
  --c-title-shadow: rgba(0, 0, 0, 0.7);
  --c-well: rgba(0, 0, 0, 0.3);
  --c-accent: #66aadd;
  --c-accent-soft: rgba(102, 170, 221, 0.18);
  --c-btn-from: #222;
  --c-btn-to: #4b555d;
  --c-btn-hover-from: #58636e;
  --c-btn-hover-to: #53626e;
  --c-btn-border: #83838390;
  --c-btn-green-from: #03380a;
  --c-btn-green-to: #3d9b3d;
  --c-btn-green-hover-from: #085c13;
  --c-btn-green-hover-to: #49a349;
  --c-btn-green-border: #91ea4b40;
  --c-btn-text-shadow: rgba(0, 0, 0, 0.8);
  --c-entry-from: #111;
  --c-entry-to: #222;
  --c-tick-border-hover: #697879;
  --c-tick-shadow: #00000055;
  --c-tick-on-from: #e7f6f5;
  --c-tick-on-to: #a0d6d7;
  --c-tick-glow: #5b62bf77;
  --c-check-label-on: #f5f5f5;
  --dota-light-grey: #8b989e;
  --dota-lighter-grey: #b0bcc2;
  --dota-lightest-grey: #dae2e5;
  --dota-loser-red: #ff4433;
  --dota-new-section-green: #52b464;
  --dota-gold: #ffcc33;

  /* Semantic (tokens.css layer 2). */
  --bg: var(--c-bg-edge);
  --bg-image: linear-gradient(180deg, var(--c-black) 0, var(--c-clear) 150px), radial-gradient(90% 75% at 60% 22%, var(--c-bg-glow) 0%, var(--c-bg-mid) 48%, var(--c-bg-edge) 100%);
  --panel: linear-gradient(180deg, var(--c-popup-from), var(--c-popup-to));
  --panel-border: var(--c-popup-border);
  --panel-shadow: 0 0 8px var(--c-black);
  --text: var(--dota-lighter-grey);
  --text-bright: var(--dota-lightest-grey);
  --muted: var(--dota-light-grey);
  --line: var(--c-line);
  --well: var(--c-well);
  --accent: var(--c-accent);
  --accent-soft: var(--c-accent-soft);
  --good: var(--dota-new-section-green);
  --bad: var(--dota-loser-red);
  --gold: var(--dota-gold);
  --title-color: var(--dota-lightest-grey);
  --title-shadow: 0 2px 6px var(--c-title-shadow);
  --btn-bg: linear-gradient(180deg, var(--c-btn-from), var(--c-btn-to));
  --btn-bg-hover: linear-gradient(180deg, var(--c-btn-hover-from), var(--c-btn-hover-to));
  --btn-border: var(--c-btn-border);
  --btn-text: var(--c-white);
  --btn-text-shadow: 0 0 5px var(--c-btn-text-shadow);
  --btn-primary-bg: linear-gradient(180deg, var(--c-btn-green-from), var(--c-btn-green-to));
  --btn-primary-hover: linear-gradient(180deg, var(--c-btn-green-hover-from), var(--c-btn-green-hover-to));
  --btn-primary-border: var(--c-btn-green-border);
  --input-bg: linear-gradient(180deg, var(--c-entry-from), var(--c-entry-to));
  --input-border: var(--c-tick-border-hover);
  --input-text: var(--c-white);
  --check-bg: var(--c-black);
  --check-border: var(--c-tick-border-hover);
  --check-on-bg: linear-gradient(180deg, var(--c-tick-on-from), var(--c-tick-on-to));
  --check-on-border: var(--c-black);
  --check-glow: var(--c-tick-glow);
  --check-shadow: var(--c-tick-shadow) 0 0 1px 3px;
  --check-label-on: var(--c-check-label-on);
  --radius-none: 0;
  --dur-fast: 0.1s;
  --ease: ease-in-out;

  /* Web only. */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-code: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --card-w: 400px;
  --card-pad: 28px;
  --tap: 48px;

  color-scheme: dark;
}

html {
  min-height: 100%;
  background: var(--bg-image), var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Brand on top, the card, a short line under it; centred on a desktop, from the top on a phone. */
.page {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 16px;
}

.brand {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-bright);
  font: 700 15px/1 var(--font);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.brand-mark {
  width: 36px;
  height: 28px;
  flex: none;
}

/* The PopupPanel: square, graphite gradient, 1px border, black glow. */
.card {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--card-w);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-none);
  box-shadow: var(--panel-shadow);
}

/* Popup title: uppercase, centred, a divider under it the full width of the card. */
.card h1 {
  margin: 0;
  padding: 20px var(--card-pad) 16px;
  border-bottom: 1px solid var(--line);
  color: var(--title-color);
  font: 700 22px/1.2 var(--font);
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: var(--title-shadow);
  overflow-wrap: anywhere;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px var(--card-pad) var(--card-pad);
}

.card-body p {
  margin: 0;
}

.lead b,
.card-body b {
  color: var(--text-bright);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
}

/* Under the card: one quiet line. */
.aside {
  margin: 0;
  max-width: var(--card-w);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* Buttons: Dota PopupButton, square, uppercase, white label with a dark glow. */
.btn {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: var(--tap);
  margin: 0;
  padding: 10px 16px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-none);
  color: var(--btn-text);
  font: 600 15px/1.2 var(--font);
  letter-spacing: 0.06em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: var(--btn-text-shadow);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}

.btn:hover {
  background: var(--btn-bg-hover);
}

/* PopupButton.Green: Steam on the choice page, "Sign in" on the code page. */
.btn-green {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-border);
}

.btn-green:hover {
  background: var(--btn-primary-hover);
}

.btn svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.btn:focus-visible,
.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* A button that reads as a link: "Send a new code". */
.link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  color: var(--accent);
  font: 600 15px/1.2 var(--font);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link:hover {
  color: var(--text-bright);
}

/* "or" between Steam and email: a thin line each side. */
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.or::before,
.or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 600;
}

/* Dota TextEntry: a near-black gradient box, square. */
.entry {
  box-sizing: border-box;
  width: 100%;
  height: var(--tap);
  margin: 0;
  padding: 0 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-none);
  box-shadow: inset 0 1px 4px var(--c-black);
  color: var(--input-text);
  font: 16px/1.2 var(--font);
}

.entry::placeholder {
  color: var(--muted);
  opacity: 1;
}

.entry:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: 0;
  box-shadow: inset 0 1px 4px var(--c-black), 0 0 12px var(--accent-soft);
}

.entry[aria-invalid='true'] {
  border-color: var(--bad);
}

/* The 6-digit code: big, centred, even digit widths. */
.entry-code {
  height: 60px;
  font: 600 28px/1 var(--font-code);
  letter-spacing: 0.45em;
  text-align: center;
  text-indent: 0.45em;
}

.entry-code::placeholder {
  color: var(--muted);
}

/* Dota ToggleButton .TickBox: black square; light square with a glow when on. The whole row is the target. */
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
}

.check:has(input:checked) {
  color: var(--check-label-on);
}

.check input {
  appearance: none;
  flex: none;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  margin: 0;
  background: var(--check-bg);
  border: 2px solid var(--check-border);
  border-radius: var(--radius-none);
  box-shadow: var(--check-shadow);
  cursor: pointer;
  transition: box-shadow var(--dur-fast) var(--ease);
}

.check input:checked {
  background: var(--check-on-bg);
  border: 3px solid var(--check-on-border);
  box-shadow: var(--check-glow) 0 0 8px 0, 0 0 0 1px var(--check-border);
}

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

/* The error line (role="alert"): one slot under the title, as errorLine() puts it today. */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--well);
  border: 1px solid var(--line);
  border-left: 3px solid var(--bad);
  color: var(--text-bright);
  font-size: 15px;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  color: var(--bad);
}

/* The good-news line (role="status") of the account page: the error line's shape with the green of a finished step. */
.done {
  margin: 0;
  padding: 10px 12px;
  background: var(--well);
  border: 1px solid var(--line);
  border-left: 3px solid var(--good);
  color: var(--text-bright);
  font-size: 15px;
}

/* Steam already confirmed: avatar, name, a green tick. */
.persona {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--well);
  border: 1px solid var(--line);
}

/* Stands in for <img class="avatar" src="https://avatars.steamstatic.com/…" alt="" width="44" height="44">. */
.avatar {
  display: block;
  flex: none;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--c-btn-to), var(--c-bg-glow));
  border: 1px solid var(--panel-border);
}

.persona-text {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.persona-text span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.persona-text b {
  display: block;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.persona > svg {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--good);
}

/* "Send a new code" under the code form, after a thin line. */
.resend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 6px;
  margin: 0;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

/* A second line under the first shares its rule. */
.resend + .resend {
  border-top: 0;
  padding-top: 0;
}

/* Result pages (done, expired, refused): an icon and the message, centred. */
.status {
  align-items: center;
  text-align: center;
}

.status-icon {
  width: 52px;
  height: 52px;
  flex: none;
}

.status-icon.good {
  color: var(--good);
}

.status-icon.warn {
  color: var(--gold);
}

.status-icon.bad {
  color: var(--bad);
}

.status-text {
  color: var(--text-bright);
  font-size: 17px;
}

/* Account page (account-page design D9): one part per subject under a hairline, its name as a small label. */
.account-part {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.account-part h2 {
  margin: 0;
  color: var(--muted);
  font: 600 13px/1.2 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Delete account: set apart by the colour of the error line, no new colour. */
.account-part.danger {
  padding-left: 12px;
  border-left: 3px solid var(--bad);
}

.btn-danger {
  border-color: var(--bad);
}

/* Premium page (#465): a wider card so two offers sit side by side; they stack once the card is too narrow. */
.card.card-wide {
  max-width: 640px;
}

.premium-includes {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.offers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.offer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--well);
  border: 1px solid var(--line);
}

/* The form sits at the bottom so both buttons line up whatever the text above them. */
.offer .form {
  margin-top: auto;
}

.offer h2 {
  margin: 0;
  color: var(--text-bright);
  font: 600 16px/1.3 var(--font);
}

.offer-price b {
  font-size: 20px;
}

.offer-best {
  border-color: var(--gold);
}

.offer-tag {
  color: var(--gold);
  font: 600 12px/1.2 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* A plain link in a text line ("Cancel" on the confirm pages). */
.card-body p a {
  color: var(--accent);
}

.card-body p a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Phones: from the top, a little tighter. */
@media (max-width: 480px) {
  .page {
    justify-content: flex-start;
    gap: 18px;
    padding: 28px 16px 24px;
  }

  :root {
    --card-pad: 20px;
  }

  .card h1 {
    font-size: 20px;
  }
}

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