/* =========================================================
   Psychosis — application form (apply/index.html)
   Loaded after /styles.css; only form-specific rules live here.
   Contrast notes (surface ~#191a1d = #0f0f12 + 4% white):
     --text  #f3f1ee  ~14:1
     --muted #9a9aa6  ~5.6:1
     error   #ff7a85  ~7.5:1 on #0f0f12, ~6.9:1 on the card
     success #6fd08c  ~9.5:1
   All AA at the 13-15px sizes used here.
   ========================================================= */

.apply-section {
  padding-top: 24px;
  padding-bottom: 56px;
}

.apply-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5.5vw, 44px);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 12px;
}

.apply-intro {
  max-width: 560px;
  margin: 0 auto 28px;
  font-size: 15px;
  color: var(--muted);
}

/* [hidden] must win over every display rule on this page (.btn is inline-flex,
   .form-card is block): the sign-in panel and the form toggle with it. */
.apply-page [hidden] {
  display: none !important;
}

/* Sign-in panel (Discord login state, history, the 7-day notice). */
.auth-card {
  max-width: 560px;
  margin: 0 auto 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 24px;
  text-align: left;
}

.auth-line {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

.auth-line + .auth-line,
.auth-line + .form-status,
.auth-actions {
  margin-top: 12px;
}

.auth-actions {
  margin-bottom: 0;
}

.auth-actions .btn {
  min-width: 200px;
}

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

/* The officer restriction ("Officers can't submit applications."), at the top
   of the card and again at the bottom of the form: centred, in the form's
   error red. #ff7a85 on the page (#0f0f12) = 7.4:1, on the box tint ~6.6:1. */
.auth-blocked.officer-block,
.officer-block {
  margin: 12px 0;
  padding: 10px 14px;
  text-align: center;
  font-weight: 600;
  color: #ff7a85;
  background: rgba(255, 122, 133, 0.08);
  border: 1px solid rgba(255, 122, 133, 0.45);
  border-radius: 8px;
}

.officer-block[hidden] { display: none; }

/* The Discord role check failed at login: a clear notice at the top of the
   portal with "Try again" (the normal login). Amber like the other notices:
   #f0b429 text on the box tint over #16161c ~9:1. */
.role-check-notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  text-align: center;
  color: var(--text);
  background: rgba(240, 180, 41, 0.08);
  border: 1px solid rgba(240, 180, 41, 0.55);
  border-radius: 8px;
}

.role-check-notice[hidden] { display: none; }
.role-check-text { margin: 0; font-weight: 600; color: #f0b429; }
.role-check-actions { margin-top: 10px; }

/* Tester bypass: the "Test Mode on" banner (#0f0f12 on #f0b429 = 10.4:1). The
   switch is the footer's Test Mode button (below). */
.bypass-banner {
  margin: 0 0 12px;
  padding: 6px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #0f0f12;
  background: #f0b429;
  border-radius: 6px;
}

.bypass-banner[hidden] { display: none; }

/* Test Mode (testers only; built in the footer by apply.js / officer.js, right
   above the copyright line). A dev tool, not part of the portal look: the bypass
   amber, dashed, on both portals. Off: neutral dashed outline; on: amber fill
   (#0f0f12 on #f0b429 = 10.4:1). The panel under it is a dashed amber box of
   tool buttons. White focus ring; no lifts or animation (nothing to cancel
   under reduced motion; styles.css also turns transitions off there). Size:
   the shared in-portal button box (end of this file). */
.test-mode { max-width: 640px; margin: 0 auto 16px; text-align: center; }
.test-mode-btn {
  color: var(--text);
  background: transparent;
  border: 1px dashed #f0b429;
  cursor: pointer;
}

.test-mode-tool {
  color: var(--text);
  background: transparent;
  border: 1px dashed #f0b429;
  cursor: pointer;
}

.test-mode-btn:hover { background: rgba(240, 180, 41, 0.12); }
.test-mode-tool:hover { background: rgba(240, 180, 41, 0.12); }
.test-mode-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.test-mode-tool:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.test-mode-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.test-mode-btn.is-on { color: #0f0f12; background: #f0b429; border-style: solid; }
.test-mode-btn.is-on:hover { background: #d99e1c; }

.test-mode-panel {
  margin: 10px 0 0;
  padding: 12px;
  border: 1px dashed #f0b429;
  border-radius: 8px;
  background: rgba(240, 180, 41, 0.05);
}

.test-mode-panel[hidden] { display: none; }
.test-mode-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.test-mode-status { margin: 10px 0 0; font-size: 13px; color: var(--text); }
.test-mode-status.is-error { color: #ff7a85; }
.test-mode-status[hidden] { display: none; }

/* "Log out" rendered as a small inline link-style button. */
.link-btn {
  margin-left: 8px;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--link);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-btn:hover { color: #fff; }

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

.link-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* No active application: the "New application" block at the top of the panel,
   above the list, centred (note, button, or the date the 7-day wait ends). */
.new-app { margin: 0 0 18px; text-align: center; }
.new-app-note { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.new-app-actions { display: flex; justify-content: center; margin: 0; }
.new-app-actions .btn { min-width: 200px; }
.new-app-actions .btn:disabled { opacity: 0.55; cursor: not-allowed; }
.new-app-wait { margin: 10px 0 0; color: var(--text); }
.history-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; }

.history-title {
  margin: 16px 0 6px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text);
}

.history {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.history-date { font-variant-numeric: tabular-nums; }
.history-what { color: var(--text); }

/* Same flat surface as .card, but no hover lift: a form should not move. */
.form-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent-line);
  border-radius: 12px;
  padding: 24px 24px 20px;
  text-align: left;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.field .optional {
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color 0.2s, background 0.2s;
}

.field textarea {
  resize: vertical;
  min-height: 96px;
}

.field-short input {
  max-width: 120px;
}

.field input:hover,
.field textarea:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--accent-line);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #ff7a85;
}

.field-hint {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

/* A question's hint sits under its label and above its field. */
.field > label + .field-hint { margin-top: -2px; margin-bottom: 8px; }

.count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.field-error {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
  color: #ff7a85;
}

.field-error[hidden] {
  display: none;
}

/* Honeypot: off-screen, not display:none (some bots skip display:none fields). */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 1.5em;
  margin: 4px 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.form-status.is-error {
  color: #ff7a85;
}

/* Information, not a problem (the idle sign-out notices): the muted text
   colour, #9a9aa6 on the page (#0f0f12) ~6.6:1, on the card ~5.6:1. */
.form-status.is-info {
  color: var(--muted);
}

/* The sign-in panel's notice line is centred like the rest of the panel. */
#auth-out .form-status {
  text-align: center;
}

.form-status.is-success {
  color: #6fd08c;
  font-weight: 600;
}

.form-actions {
  display: flex;
  justify-content: center;
}

.form-actions .btn {
  min-width: 200px;
  cursor: pointer;
}

/* .btn sets display:inline-flex, which would beat the UA's [hidden] rule. */
.form-actions .btn[hidden] {
  display: none;
}

.form-actions .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-status a,
noscript a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-status a:hover {
  color: #fff;
}

/* Signed out: ONE login button (Discord's "Sign in with [logo]" brand button), centred. */
.auth-login {
  display: grid;
  grid-template-columns: auto;
  justify-content: center;
  margin-top: 0;
}


/* The active application, read-only. */
.active-app { margin-top: 4px; }

.active-sub {
  margin: 14px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.char-list {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.answers {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.answers dt {
  margin-top: 10px;
  font-weight: 600;
  color: var(--text);
}

.answers dd {
  margin: 2px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.active-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.active-actions .btn {
  min-width: 0;
  cursor: pointer;
}

/* Danger buttons: red border AND red glow on hover and keyboard focus (the
   shared .btn-secondary:hover glow is the theme's --glow-red, blue here). */
.btn-danger:hover,
.btn-danger:focus-visible {
  border-color: rgb(var(--danger-rgb));
  box-shadow: var(--glow-danger);
}

.form-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: #fff;
}

/* Characters: Battle.net picks, lookup rows and verified character cards. */
.chars {
  border: 0;
  padding: 0;
  min-width: 0;
}

.chars legend {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  padding: 0;
}

.bnet-box {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  /* OPAQUE: the flat look of its old 2% white over the form's 4% white over the
     page base #0f0f12 (both themes), so the body glows behind it can never
     change the contrast of the class-coloured rows. */
  background: #1e1e20;
}

.bnet-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.8;
}

.bnet-list li { display: flex; align-items: baseline; gap: 10px; }
/* Each picker row in its character's class colour (the same --class-color as
   the card accents, set by the allowlisted char-class-* class); an unknown
   class keeps the default text colour. The Add link keeps the link style. */
.bnet-list .bnet-name { color: var(--class-text-color, var(--class-color, inherit)); }
/* Class colour as TEXT on the solid box (#1e1e20) needs 4.7:1. Every exact
   class colour reaches it except Shaman's #0070DE (3.47:1): its text uses the
   same hue lightened to #0E88FF (4.74:1). The card edges keep the exact class
   colours (--class-color). */
.bnet-list .char-class-shaman { --class-text-color: #0E88FF; }
.bnet-list .link-btn { margin-left: auto; color: var(--link); }

/* One lookup row: name input + Lookup + Remove, the error underneath. */
.char-row {
  margin-top: 10px;
}

/* minmax(0, 1fr) + min-width: 0 on the name cell and its input: the name column
   gives way to the buttons instead of pushing the row past the card. */
.char-lookup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: start;
}

/* The hint sits above the input, so the buttons line up with the input's bottom edge. */
.char-lookup .char-cell .field-hint { margin: 0 0 6px; }
.char-lookup .btn { align-self: end; }
.char-lookup .char-cell,
.char-lookup .char-cell input { min-width: 0; }
.char-row-error { grid-column: 1 / -1; margin: 2px 0 0; }

.char-row[data-invalid] input { border-color: #ff7a85; }

.char-cell label {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 4px;
}

.char-cell input { padding: 8px 10px; }

/* A verified character: accent left edge (blue / gold by theme), the class wallpaper at 7% opacity
   behind everything, so the card stays dark and its text keeps AA contrast.
   The large red x (top right, alone) removes it. Layout: one centred block,
   the portrait card (the Armory link) beside name / level / race / class /
   guild as a centred pair, then the professions line and the centred
   "Desired Role" / "Desired Spec" block; side padding is symmetric so the
   x never pushes the block off centre. Under 600 px everything stacks,
   centred. The officer view uses the same layout. The cls-<class id> rules below are
   the ONE class -> wallpaper mapping: each file under the classes folder is a
   drop-in (replace it with larger art under the same name). */
.char-card {
  position: relative;
  isolation: isolate;
  display: grid;
  /* Two flexible side tracks centre the portrait (104 px: 96 + 3 px padding + 1 px
     border) and the name column, while full-width rows (professions, roles /
     specs) span the whole card, not just the centred pair. */
  grid-template-columns: minmax(0, 1fr) 104px minmax(0, max-content) minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 8px;
  align-items: center;
  padding: 12px 52px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--class-color, var(--accent-line)); /* class colour; unknown class: the accent */
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

/* The left accent of a card in its WoW class colour (classic-era
   RAID_CLASS_COLORS); char-class-<class> is set only for the nine known
   classes, anything else keeps the accent blue (gold for officers). No text
   sits on these colours. Shared with the officer view. */
.char-card.char-class-warrior,
.bnet-list .char-class-warrior { --class-color: #C79C6E; }
.char-card.char-class-paladin,
.bnet-list .char-class-paladin { --class-color: #F58CBA; }
.char-card.char-class-hunter,
.bnet-list .char-class-hunter { --class-color: #ABD473; }
.char-card.char-class-rogue,
.bnet-list .char-class-rogue { --class-color: #FFF569; }
.char-card.char-class-priest,
.bnet-list .char-class-priest { --class-color: #FFFFFF; }
.char-card.char-class-shaman,
.bnet-list .char-class-shaman { --class-color: #0070DE; }
.char-card.char-class-mage,
.bnet-list .char-class-mage { --class-color: #69CCF0; }
.char-card.char-class-warlock,
.bnet-list .char-class-warlock { --class-color: #9482C9; }
.char-card.char-class-druid,
.bnet-list .char-class-druid { --class-color: #FF7D0A; }

.char-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: 0.07;
  pointer-events: none;
}

.char-card.cls-1::before { background-image: url("/assets/classes/warrior.webp"); }
.char-card.cls-2::before { background-image: url("/assets/classes/paladin.webp"); }
.char-card.cls-3::before { background-image: url("/assets/classes/hunter.webp"); }
.char-card.cls-4::before { background-image: url("/assets/classes/rogue.webp"); }
.char-card.cls-5::before { background-image: url("/assets/classes/priest.webp"); }
.char-card.cls-7::before { background-image: url("/assets/classes/shaman.webp"); }
.char-card.cls-8::before { background-image: url("/assets/classes/mage.webp"); }
.char-card.cls-9::before { background-image: url("/assets/classes/warlock.webp"); }
.char-card.cls-11::before { background-image: url("/assets/classes/druid.webp"); }
/* Framing: keep the face in view on the wide card (cover crops top and bottom). */
.char-card.cls-2::before,
.char-card.cls-3::before { background-position: center 15%; }
.char-card.cls-4::before { background-position: 35% 15%; }

/* The character's Blizzard full-body render ("main-raw", 1600x1200, body at
   roughly x 30-62 %, y 29-82 % of the frame) replaces the class art once it
   has loaded (.has-render; apply.js / officer.js renderLayer). Decorative
   (alt "", aria-hidden), absolutely placed behind the content (no layout
   shift), covering the whole right side of the card at full height. Crop: the
   image is 180 % of the layer's height, shifted up 49 % and centred on the
   body (x 47 %), so head to feet spans the card top to bottom. A subtle
   wallpaper like the class art: no brightening (saturate 0.9 only), layer
   opacity 0.2, so it never competes with the portrait, text or buttons.
   Masked to melt into the card from the left; a faint wash of the class colour
   comes in from the left. A load error removes the layer, so the class art
   shows exactly as before. No animation (nothing for prefers-reduced-motion
   to stop). Shared with the officer view (officer/index.html loads this file). */
.char-render {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  width: 55%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 40%);
  mask-image: linear-gradient(to right, transparent 0%, #000 40%);
}
.char-render > img {
  position: absolute;
  top: -49%;
  left: 50%;
  width: auto;
  max-width: none;
  height: 180%;
  transform: translateX(-47%);
  filter: saturate(0.9);
}
.char-card.has-render > .char-render { opacity: 0.2; }
/* Class art off once the render is showing; the class colour washes in from the left. */
.char-card.has-render::before {
  background-image: linear-gradient(to right, var(--class-color, var(--accent-line)) 0%, transparent 60%);
  background-size: auto;
  opacity: 0.1;
}

.char-x {
  position: absolute;
  top: 6px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 38px;
  height: 38px;
  padding: 0;
  font: inherit;
  line-height: 1;
  color: #ff4d5e;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

/* The x is two geometric bars, not a font glyph, so it sits exactly at the
   centre of the square (glyph metrics put the text x off-centre). */
.char-x::before,
.char-x::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
}
.char-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.char-x::after { transform: translate(-50%, -50%) rotate(-45deg); }

.char-x:hover { color: #ff7a85; background: rgba(255, 77, 94, 0.12); }
.char-x:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.char-avatar {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  background: #1c1c22;
}

/* Neutral placeholder (no render yet, or none at all): a plain tile with a
   simple head-and-shoulders silhouette drawn in CSS. */
.char-avatar.is-empty {
  position: relative;
  border: 1px solid var(--border);
  overflow: hidden;
}

.char-avatar.is-empty::before,
.char-avatar.is-empty::after {
  content: "";
  position: absolute;
  left: 50%;
  background: #3a3a44;
  transform: translateX(-50%);
}

.char-avatar.is-empty::before { top: 19px; width: 34px; height: 34px; border-radius: 50%; }
.char-avatar.is-empty::after { bottom: -24px; width: 68px; height: 52px; border-radius: 50%; }

/* The card's left column: the portrait card (96 px portrait). With a valid Armory URL the
   whole card is the link (<a class="char-portrait is-link">): the portrait,
   then the chain icon and "Armory" under it. Without one it is the portrait alone. */
.char-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 104px; /* border-box: the 96 px portrait + 3 px padding + 1 px border each side */
  padding: 3px;
  align-self: start;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
}

.char-portrait.is-link {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.18);
  transition: border-color 0.15s, background 0.15s;
}

.char-portrait.is-link:hover { border-color: var(--accent-line); background: rgba(255, 255, 255, 0.08); }
.char-portrait.is-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.char-armory-text {
  display: inline-flex;
  align-items: center;  /* centres the chain icon on the text */
  gap: 0.25em;
  padding-bottom: 2px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.char-card > .char-portrait { grid-column: 2; }
.char-card > .char-info { grid-column: 3; }
.char-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.char-card-name { font-size: 15px; color: #fff; overflow-wrap: anywhere; }
.char-card-meta { font-size: 13px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.class-icon { display: block; width: 18px; height: 18px; border-radius: 4px; }
.char-card-guild { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* "Professions:" + icons; the name shows on hover and on keyboard focus. */
.char-profline {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.char-profline-label { font-weight: 600; }

.prof-icon { position: relative; display: inline-block; border-radius: 6px; }
.prof-icon img { display: block; width: 28px; height: 28px; border-radius: 6px; }
.prof-icon:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.prof-icon:hover::after,
.prof-icon:focus::after {
  content: attr(data-name);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  z-index: 2;
  padding: 3px 8px;
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  background: #101014;
  border: 1px solid var(--border);
  border-radius: 6px;
  pointer-events: none;
}

.prof-missing { color: #ff7a85; }
.prof-q { font-weight: 700; font-size: 15px; }

/* "Desired Role" + its tiles, then "Desired Spec" + its tiles, the whole block
   centred in the card (headings and tile rows). Shared with the officer view. */
.char-card .char-rolespec {
  grid-column: 1 / -1;
  justify-self: stretch;
  margin: 6px 0 0;
  min-width: 0;
  text-align: center;
  container-type: inline-size; /* the tile rows below size from the card's width */
}

.char-rolespec-title {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}

/* Role / spec tile rows (form toggles and officer chips): one column per tile
   (tiles-<n>, set by the scripts), up to 112 px each, centred. 1-3 tiles are
   always one line; 4 (Druid roles) are one line when the block is at least
   472 px wide, else 2 + 2. Under 300 px the tiles lose some padding and type
   size so three still fit on a 320 px phone. */
.char-rolespec .icon-toggle-grid,
.char-rolespec .icon-chip-grid {
  display: grid;
  grid-template-columns: repeat(var(--tiles, 3), minmax(0, 112px));
  justify-content: center;
  gap: 8px;
}

.char-rolespec .tiles-1 { --tiles: 1; }
.char-rolespec .tiles-2 { --tiles: 2; }
.char-rolespec .tiles-3 { --tiles: 3; }
.char-rolespec .tiles-4 { --tiles: 4; }

@container (max-width: 471px) {
  .char-rolespec .tiles-4 { --tiles: 2; }
}

@container (max-width: 299px) {
  .char-rolespec .icon-toggle-grid,
  .char-rolespec .icon-chip-grid { gap: 6px; }
  .char-rolespec .toggle-btn.icon-toggle,
  .char-rolespec .icon-chip { padding: 8px 2px; font-size: 11px; }
}

/* The inline error under a card that misses a role / spec (full width, centred like the block above). */
.char-card .char-card-error { grid-column: 1 / -1; justify-self: stretch; margin: 2px 0 0; text-align: center; }

.icon-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.toggle-btn.icon-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 6px;
  font-size: 12px;
  text-align: center;
}

.icon-toggle img { display: block; width: 36px; height: 36px; border-radius: 6px; }
.icon-toggle img.tile-icon { width: 48px; height: 48px; }
.icon-toggle-label { overflow-wrap: anywhere; }

.chars-actions { margin: 12px 0 0; }

.form-actions { gap: 10px; }

/* Toggle buttons (interests, activities, raid Yes / No, roles, specs,
   professions): multi-select. Hover = the --toggle-hover border (neutral
   light grey on applicant pages, where the blue hover would match selected;
   gold under body.theme-officer).
   aria-pressed="true" = selected = a light blue 2px --selected border plus a
   faint 14% tint of it, text stays --text (no solid fill); hovering a selected
   toggle keeps the blue. Gold under body.theme-officer. Every toggle has a 2px
   border so selecting one never shifts the layout. Numbers in styles.css :root. */
.toggles { border: 0; padding: 0; min-width: 0; }

.toggles legend,
.char-profs legend {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  padding: 0;
}

.toggle-row { display: flex; gap: 8px; margin-top: 6px; }
.toggle-row-3 > .toggle-btn { flex: 1 1 0; min-width: 0; }
.toggle-row-wrap { flex-wrap: wrap; }

.toggle-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  padding: 9px 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.toggle-btn:hover { border-color: var(--toggle-hover); }

.toggle-btn[aria-pressed="true"] {
  color: var(--text);
  background: rgba(var(--selected-rgb), 0.14);
  border-color: var(--selected);
}

.toggle-btn[aria-pressed="true"]:hover { background: rgba(var(--selected-rgb), 0.18); border-color: var(--selected); }

.toggle-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.toggle-btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.toggle-sm { font-size: 13px; padding: 5px 9px; }

/* Activity tiles (interests, PvP and PvE activities): a self-hosted WoW
   Blizzard art crop (assets/art/<tile>.webp, built by infra/fetch-art.sh) as
   a cover background, darkened by a 65% #0a0a0d shade so the centered white
   label stays AA: white on the brightest pixel of any tile under the shade
   (plus the 14% selected tint) is >= 5.4:1, before the text shadow. */
.toggle-btn.art-tile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.9);
  background: #141418;
}

.toggle-btn.art-tile::before,
.toggle-btn.art-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.toggle-btn.art-tile::before {
  z-index: -2;
  background-color: #141418;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.toggle-btn.art-tile::after { z-index: -1; background: rgba(10, 10, 13, 0.65); }

.toggle-btn.art-tile[aria-pressed="true"] { color: #fff; background: #141418; }

.toggle-btn.art-tile[aria-pressed="true"]::after {
  background: linear-gradient(rgba(var(--selected-rgb), 0.14), rgba(var(--selected-rgb), 0.14)), rgba(10, 10, 13, 0.65);
}

.art-tile[data-value="social"]::before { background-image: url("/assets/art/social.webp"); }
.art-tile[data-value="pvp"]::before { background-image: url("/assets/art/pvp.webp"); }
.art-tile[data-value="pve"]::before { background-image: url("/assets/art/pve.webp"); }
.art-tile[data-value="world"]::before { background-image: url("/assets/art/world.webp"); }
.art-tile[data-value="battlegrounds"]::before { background-image: url("/assets/art/battlegrounds.webp"); }
.art-tile[data-value="dueling"]::before { background-image: url("/assets/art/dueling.webp"); }
.art-tile[data-value="raids"]::before { background-image: url("/assets/art/raids.webp"); }
.art-tile[data-value="dungeons"]::before { background-image: url("/assets/art/dungeons.webp"); }
.art-tile[data-value="leveling"]::before { background-image: url("/assets/art/leveling.webp"); }

/* The dwarf's face sits near the top of the PvP art: keep it in frame when a
   wide tile makes cover crop the top and bottom. */
.art-tile[data-value="pvp"]::before { background-position: center 15%; }

/* The applicant page's primary buttons (Submit Application, Try again
   etc.; NOT the Discord sign-in button, which keeps Discord's blurple): the --cta fill (Battle.net blue under body.theme-applicant, gold
   under body.theme-officer), --cta-hover on hover.
   The portal bar keeps its own. */
.apply-page .btn-primary {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--on-cta);
}

.apply-page .btn-primary:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  color: var(--on-cta);
  box-shadow: var(--glow-red);
}

/* An open interest's questions: inline parts of the form (same background,
   normal field spacing), set off by a subtle neutral divider only. */
.section-box {
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
}

/* Attention notice: faint yellow tint + orange border (no red accent).
   --text on the tint composited over the page is >= 11.5:1 worst case
   (under the page glow, inside a card), well above AA 4.5:1. */
.raid-notice {
  margin: 0 0 18px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: rgba(250, 204, 21, 0.10);
  border: 1px solid #f59e0b;
  border-radius: 8px;
}

/* The raid Yes / No pair. */
.toggle-row-2 > .toggle-btn { flex: 1 1 0; min-width: 0; }

/* Character counter inside the textarea's bottom-right corner; the textarea
   keeps room at the bottom so typed text never runs under it. */
.ta-wrap { position: relative; }

.field .ta-wrap textarea { padding-bottom: 30px; }

.ta-count {
  position: absolute;
  right: 20px; /* clear of the 8px scrollbar (plus the 1px border) */
  bottom: 8px;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}

/* Themed scrollbars for textareas (apply and officer pages, which share this
   file): thin, muted neutral grey thumb, transparent track, no arrow buttons. */
textarea {
  scrollbar-width: thin;
  scrollbar-color: rgba(154, 154, 166, 0.45) transparent;
}

textarea::-webkit-scrollbar { width: 8px; height: 8px; }
textarea::-webkit-scrollbar-track { background: transparent; }
textarea::-webkit-scrollbar-corner { background: transparent; }
textarea::-webkit-scrollbar-button { display: none; }

textarea::-webkit-scrollbar-thumb {
  background: rgba(154, 154, 166, 0.45);
  border-radius: 8px;
}

textarea::-webkit-scrollbar-thumb:hover { background: rgba(154, 154, 166, 0.7); }

/* Primary professions on a character card. */
.char-card .char-profs { grid-column: 1 / -1; justify-self: stretch; border: 0; padding: 0; margin: 4px 0 0; min-width: 0; text-align: center; }
.char-profs .icon-toggle-grid { display: flex; flex-wrap: wrap; justify-content: center; }
.char-profs .icon-toggle-grid > .icon-toggle { flex: 0 1 104px; }
.char-profs .field-hint { margin-top: 0; }

/* Battle.net: linked state and its actions. */
/* "Linked: <BattleTag>": the whole line in the Battle.net blue used for text
   (#4da3ff, 6.28:1 on the box; the #006bd1 button fill is too dark for text),
   only the BattleTag bold. Fixed, so the officer preview keeps it blue too. */
.bnet-linked { font-weight: 400; color: #4da3ff; }
.bnet-linked strong { font-weight: 700; }
.bnet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bnet-actions .btn { cursor: pointer; }

/* History rows: Restart / Delete (with its confirm step), Continue / Delete draft.
   Real buttons in the shared box, on their own line under the row text. */
.history li + li { margin-top: 10px; }
.history-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.history-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.history-confirm[hidden] { display: none; }
.history-confirm-text { color: var(--text); }
.history-delete-yes { color: #ff7a85; }

.legacy-answers-note { margin: -8px 0 16px; }

/* Keep the honeypot hidden even when the browser prints the page. */
@media print {
  .hp { display: none; }
}

@media (max-width: 600px) {
  .apply-section { padding-top: 16px; padding-bottom: 40px; }
  .form-card { padding: 18px 16px 16px; }
  .auth-card { padding: 16px; }
  .auth-actions .btn { width: 100%; }
  .bnet-actions .btn { width: auto; flex: 1 1 auto; } /* Connect + Unlink share a row until it wraps */
  .field input,
  .field textarea { font-size: 16px; } /* stops iOS zooming into the field */
  .form-actions .btn,
  .draft-actions .btn { width: 100%; }
  .form-actions { flex-direction: column; }
  .char-lookup { grid-template-columns: minmax(0, 1fr) auto; }
  .idle-dialog .btn { width: 100%; }
  .char-lookup .char-remove { justify-self: start; }
  /* Stacked and centred: portrait, then name / meta / guild, professions, roles / specs. */
  .char-card { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 12px 14px; }
  .char-card > .char-portrait,
  .char-card > .char-info { grid-column: 1; }
  .char-card .char-info { align-items: center; text-align: center; }
  .toggle-btn { font-size: 13px; padding: 9px 5px; }
  .char-render { width: 70%; height: 100%; }
}

@media (max-width: 420px) {
  .auth-login { grid-template-columns: 1fr; }
  /* Narrow phones: a slightly smaller portrait so the name column keeps room. */
  .char-portrait { width: 84px; } /* the 76 px portrait + padding + border */
  .char-avatar { width: 76px; height: 76px; }
  .char-armory-text { font-size: 12px; }
}

/* "Connect to Battle.net": styled like Battle.net's own Continue button, the
   white Battle.net mark (assets/bnet-logo.svg) left of the label. Fixed blues,
   not the accent variables, so no portal theme ever recolors it.
   #fff on #006bd1 = 5.22:1, on the #0074e0 hover = 4.59:1 (#0074e0 at rest
   would pass at 4.59:1 but leaves no AA-safe lighter hover; #1a84e8 is
   3.81:1). The 2px #4da3ff ring (6.63:1 vs the card) is an inset box-shadow,
   so hover / focus never change the size. Size, type and radius: the shared
   in-portal button box (end of this file), the same as Unlink beside it; the
   1px border is the fill colour, so it reads as borderless. */
.bnet-actions .btn.btn-bnet {
  gap: 8px;
  color: #fff;
  background: #006bd1;
  border-color: #006bd1;
  box-shadow: none;
  transition: background 0.15s, box-shadow 0.15s;
}

.bnet-actions .btn.btn-bnet:hover {
  color: #fff;
  background: #0074e0;
  border-color: #0074e0;
  box-shadow: inset 0 0 0 2px #4da3ff;
  transform: none;
}

.bnet-actions .btn.btn-bnet:focus-visible {
  color: #fff;
  outline: 0;
  box-shadow: inset 0 0 0 2px #4da3ff, 0 0 0 2px #4da3ff;
}

.bnet-mark { display: block; width: 18px; height: 18px; flex: 0 0 18px; }

/* Discord's "Blurple" brand button (Social SDK branding guidelines): text, then the
   official white Discord logo (mark + wordmark, assets/discord-logo-white.svg, never
   recoloured or distorted: fixed 132x20 = its 635.3:96 ratio). Gradient 45deg #4752C4
   -> #6571F3, 1px rgba(0,0,0,0.08) border, white text, 40px pill. GG Sans cannot be
   hosted, so a system sans-serif at 600. Side padding ~ the mark's width (26px at this
   size); the text-logo gap is one word space (0.4em, ~8px at 19px, ~0.3x the side
   padding, per Discord's spacing guide; the SVG has no inner padding). Fixed colours on every portal theme.
   Contrast: #fff on #4752C4 = 6.42:1 (the text sits on this, darker, end of the 45deg
   gradient), on #6571F3 = 4.03:1; hover ends #5561D8 = 5.14:1, #7480FF = 3.35:1. 19px at
   600 counts as large text (>= 3:1 everywhere, >= 4.5:1 under the text). */
.btn-discord-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 40px;
  background: linear-gradient(45deg, #4752C4, #6571F3);
  color: #FFFFFF;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-discord-signin:hover {
  background: linear-gradient(45deg, #5561D8, #7480FF);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(88, 101, 242, 0.35);
}
.btn-discord-signin:focus-visible {
  background: linear-gradient(45deg, #5561D8, #7480FF);
  color: #FFFFFF;
  outline: 3px solid #FFFFFF;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #4752C4;
}
/* The text's x-height sits on the logo's: the logo is nudged so the wordmark's baseline
   lines up with the text baseline. */
.discord-signin-text { display: block; transform: translateY(-1px); }
.discord-logo { display: block; width: 132px; height: 20px; flex: 0 0 132px; }
/* Very narrow phones: the same proportions, a little tighter, so the pill never overflows. */
@media (max-width: 380px) {
  .btn-discord-signin { gap: 0.4em; padding: 0 18px; font-size: 17px; }
}
/* The narrowest phones (320-340px): scaled down again so the pill stays on one line with
   room to spare: 15px text, the logo at its own ratio (106x16), 14px sides, 0.4em gap. */
@media (max-width: 340px) {
  .btn-discord-signin { padding: 0 14px; font-size: 15px; }
  .discord-logo { width: 106px; height: 16px; flex: 0 0 106px; }
}
/* A failed Discord login: Discord's error state with "Try again" (restarts the login).
   "Try again" takes the place of the Discord sign-in button, so it wears the same
   box: 52px pill, the same font stack, 19px at 600 (17px under 380px, 15px under 340px), 1px border.
   Only its colours differ (the outline .btn-secondary ones). */
.login-failed-actions .btn {
  min-height: 52px;
  padding: 0 26px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
  border-width: 1px;
  border-radius: 40px;
  min-width: auto; /* not .auth-actions' 200px or phone 100%: sized by its label, like the pill */
  width: auto;
}
@media (max-width: 380px) {
  .login-failed-actions .btn { padding: 0 18px; font-size: 17px; }
}
@media (max-width: 340px) {
  .login-failed-actions .btn { padding: 0 14px; font-size: 15px; }
  /* Narrower box sides so "Refresh from Battle.net" keeps its label on one line at 320px. */
  .bnet-box { padding-left: 8px; padding-right: 8px; }
}
.login-failed { margin: 0 0 12px; text-align: center; }
.login-failed-text { margin: 0 0 10px; font-size: 16px; font-weight: 600; color: var(--text); }
.login-failed-actions { justify-content: center; }
.auth-password-note { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }
/* The same note under Connect to Battle.net, aligned with the Battle.net box. */
.bnet-box .bnet-password-note { margin-top: 8px; text-align: inherit; }
.auth-privacy { margin-top: 8px; font-size: 13px; text-align: center; }
/* The sign-in page (login/index.html, body.login-page) when already signed in:
   "You are signed in as ..." and Continue sit centred exactly where the Discord
   button sits when signed out, and Continue wears the Discord button's pill
   (.btn-discord-signin: 52px, same font, size, weight and padding) at the
   pill's width, so the card looks the same in both states. Scoped to
   .login-page: .auth-line / .auth-actions stay left-aligned on the apply page. */
.login-page .login-signed-in { text-align: center; }
.login-page .login-signed-in .auth-line { text-align: center; }
.login-page .login-signed-in .auth-actions { display: flex; justify-content: center; margin-top: 12px; }
.login-page .login-signed-in .btn-discord-signin { min-width: 300px; max-width: 100%; box-sizing: border-box; }
@media (max-width: 380px) {
  .login-page .login-signed-in .btn-discord-signin { min-width: 280px; }
}
@media (max-width: 340px) {
  .login-page .login-signed-in .btn-discord-signin { min-width: 230px; }
}
.auth-privacy a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }

/* Application status colours (applicant history / active view, officer list,
   detail and status filter): status-<code> from the allowlist in apply.js /
   officer.js statusClass(). All >= 6.6:1 on the dark card and page. Pending
   (delivery unconfirmed) keeps its own look. */
.status-submitted,
.answers dd.status-submitted { color: #4da3ff; }
.status-accepted,
.answers dd.status-accepted { color: #4ade80; }
.status-declined,
.answers dd.status-declined { color: #fb923c; }
.status-withdrawn,
.answers dd.status-withdrawn { color: #facc15; }
/* An unsent draft: neutral grey (#b8b8c2: 9.37:1 on the page, 8.4:1 on the card). */
.status-draft { color: #b8b8c2; }

.draft-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 10px; }
.draft-actions .btn-draft[hidden] { display: none; }
.draft-actions[hidden] { display: none; }
.draft-actions .btn-draft { min-width: 200px; cursor: pointer; }
.draft-actions .btn-draft:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* The chain icon before "Armory" (Material Symbols "link", inline SVG): the
   size of the text, filled with the link's colour. */
.link-icon {
  flex: none;
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
  vertical-align: middle;
}

/* The shared in-portal button box (owner rule: buttons in one group or nearby
   share one height, font, size, weight, padding and radius; only the colour
   differs by role). Every button group on the Applicant and Officer Portals
   below uses it: the role-check Try again, New application and the
   history Restart / Delete / Continue / Delete draft, Edit / Withdraw, Battle.net
   Connect / Refresh + Unlink, Lookup / Remove / + Add new character, Save Draft /
   Reload draft above Submit / Cancel (and the officer Save decision), and the
   idle dialog's Stay signed in, plus the footer Test Mode button and its tools. 14px at 600 on a 1.3 line, 10px 20px padding,
   1px border, 8px radius, 44px minimum height (a full touch target). Only
   colours, backgrounds and border colours/styles differ (Submit is the --cta
   fill, Save Draft the outline secondary, Test Mode amber dashed, Battle.net its
   brand blue). infra/test_apply_js.py ButtonConsistencyTests checks it. */
.role-check-actions .btn,
.new-app-actions .btn,
.history-actions .btn,
.active-actions .btn,
.bnet-actions .btn,
.char-lookup .btn,
.chars-actions .btn,
.draft-actions .btn,
.form-actions .btn,
.idle-dialog .btn,
.test-mode .test-mode-btn,
.test-mode .test-mode-tool {
  min-width: 0; /* never .btn's 160px (140px on phones), so a row can share a 360px screen */
  min-height: 44px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  border-width: 1px;
  border-radius: 8px;
}

/* Reduced motion: no hover lifts. styles.css's .btn:hover override is not
   specific enough (and comes earlier) for these, so each is repeated here
   with its own selector. Transitions are already off (styles.css). */
@media (prefers-reduced-motion: reduce) {
  .btn-discord-signin:hover { transform: none; }
}
