/* ============================================================
   AUTH SURFACE — the two logged-out login pages, in Panel v2.

   ONE stylesheet for both:
   - customer  /sspanel/           (sspanel.tpl)
   - Death Star /sspanel/deathstar/ (sspanel-deathstar.tpl)

   Scope is body.pv2auth, added by BOTH templates under exactly the
   condition that renders the login markup. It cannot be body.pnv2 /
   body.dsv2 tokens alone: the customer page is PRE-AUTH, so pnv2 never
   applies there and panel-v2-core.css is not even loaded. So the
   --pv2-* tokens are redeclared here (same names, same values as
   panel-v2-core.css / deathstar-v2-core.css — one palette) and every
   component is namespaced .pv2a-* inside a .pv2a wrapper, so nothing
   leaks into the order form that shares sspanel.tpl.

   Design contract: CLAUDE-DESIGN-SYSTEM.md.
   ============================================================ */

body.pv2auth {
	--pv2-surface: #1a1a1b;      /* deep chrome: card headers */
	--pv2-panel: #212122;        /* card body */
	--pv2-raised: #252526;
	--pv2-field: #2d2d2e;        /* inputs, wells, SSO buttons */
	--pv2-hover: #333333;
	--pv2-border: #3a3a3b;
	--pv2-border-strong: #4c4c4d;
	--pv2-line: #2c2c2d;
	--pv2-text: #ffffff;
	--pv2-text-soft: #cccccc;
	--pv2-text-muted: #999999;
	--pv2-text-dim: #666666;
	--pv2-accent: #d5a84a;
	--pv2-gold: #eaa824;
	--pv2-gold-deep: #db9b15;
	--pv2-ok: #64d977;
	--pv2-danger: #f25757;
	--pv2-radius: 4px;           /* controls */
	--pv2-radius-lg: 6px;        /* cards */
	/* the auth surface's ONE control height. Deliberately taller than the
	   panel's 32px toolbar height: this is the single form every customer
	   types into, and 32px reads thin on a centred card. Every control
	   inside a card is this height, so the one-height-per-row rule holds. */
	--pv2a-ctl: 38px;
}

/* ---------- wrapper ---------- */
body.pv2auth .pv2a {
	max-width: 900px; margin: 34px auto 60px; padding: 0 16px;
	width: 100%; box-sizing: border-box;
	font-family: 'Open Sans', Arial, sans-serif;
	color: var(--pv2-text-soft);
}
body.pv2auth .pv2a *, body.pv2auth .pv2a *:before, body.pv2auth .pv2a *:after { box-sizing: border-box; }

/* page heading — only used where the shell has no title band of its own
   (Death Star). The customer page keeps its parallax title band, so the
   title is never printed twice. */
body.pv2auth .pv2a-head { text-align: center; margin: 0 0 22px; }
body.pv2auth .pv2a-head h1 {
	margin: 0; color: #fff; line-height: 1.25;
	font-family: 'Open Sans', Arial, sans-serif; font-size: 24px; font-weight: 400;
	text-transform: uppercase; letter-spacing: .02em;
}
body.pv2auth .pv2a-head p { margin: 7px 0 0; font-size: 13px; color: var(--pv2-text-muted); }

/* ---------- the two-card grid (customer) ---------- */
body.pv2auth .pv2a-grid {
	display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start;
}
body.pv2auth .pv2a-col { flex: 1 1 0; min-width: 300px; }

/* a single centred card: forgot password, SSO name completion, waits */
body.pv2auth .pv2a-solo { max-width: 420px; margin: 0 auto; width: 100%; }

/* ---------- card ---------- */
body.pv2auth .pv2a-card {
	background: var(--pv2-panel); border: 1px solid var(--pv2-border);
	border-radius: var(--pv2-radius-lg); overflow: hidden;
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
	margin: 0;
}
body.pv2auth .pv2a-chead {
	display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px;
	background: var(--pv2-surface); border-bottom: 1px solid var(--pv2-line);
}
body.pv2auth .pv2a-chead h2 {
	margin: 0; color: #fff; text-transform: uppercase; letter-spacing: .05em;
	font-family: 'Open Sans', Arial, sans-serif; font-size: 13px; font-weight: 600;
}
body.pv2auth .pv2a-chead i { color: var(--pv2-accent); font-size: 14px; }
body.pv2auth .pv2a-cbody { padding: 18px; }

/* ---------- alerts ---------- */
body.pv2auth .pv2a-alert {
	border: 1px solid; border-radius: var(--pv2-radius);
	padding: 9px 12px; margin: 0 0 14px; font-size: 13px; line-height: 1.45;
}
body.pv2auth .pv2a-alert.danger { background: rgba(242, 87, 87, 0.10); border-color: rgba(242, 87, 87, 0.42); color: #f79a9a; }
body.pv2auth .pv2a-alert.ok { background: rgba(100, 217, 119, 0.10); border-color: rgba(100, 217, 119, 0.42); color: #93e3a3; }

/* ---------- SSO buttons ----------
   dark chrome, never gold: three solid-gold buttons stacked is the same
   "way too bright" rejection the game cards' Manage button got. The brand
   mark sits in a fixed lane so all three glyphs line up on one axis. */
body.pv2auth .pv2a-sso { display: flex; flex-direction: column; gap: 8px; }
body.pv2auth .pv2a-ssobtn {
	display: flex; align-items: center; width: 100%;
	height: var(--pv2a-ctl); padding: 0; margin: 0;
	background: var(--pv2-field); border: 1px solid var(--pv2-border);
	border-radius: var(--pv2-radius); color: #fff; cursor: pointer;
	font-family: 'Open Sans', Arial, sans-serif; font-size: 13px; font-weight: 600;
	line-height: 1; text-align: left; text-shadow: none; box-shadow: none;
	transition: background-color .12s, border-color .12s;
	overflow: hidden;
}
body.pv2auth .pv2a-ssobtn:hover { background: var(--pv2-hover); border-color: var(--pv2-border-strong); }
body.pv2auth .pv2a-ssomark {
	flex: 0 0 42px; display: flex; align-items: center; justify-content: center;
	height: 100%; border-right: 1px solid var(--pv2-border); font-size: 16px;
}
body.pv2auth .pv2a-ssomark img { width: 17px; height: 17px; display: block; }
body.pv2auth .pv2a-ssomark .fa-twitch { color: #a970ff; }
body.pv2auth .pv2a-ssomark .fa-discord { color: #5865f2; }
body.pv2auth .pv2a-ssobtn span.pv2a-ssotxt {
	flex: 1 1 auto; min-width: 0; padding: 0 12px;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- "or" rule ---------- */
body.pv2auth .pv2a-or {
	display: flex; align-items: center; gap: 12px;
	margin: 16px 0; color: var(--pv2-text-dim);
	font-size: 11px; font-weight: 600; letter-spacing: .10em; text-transform: uppercase;
}
body.pv2auth .pv2a-or:before, body.pv2auth .pv2a-or:after {
	content: ""; flex: 1 1 auto; height: 1px; background: var(--pv2-line);
}

/* ---------- fields ---------- */
body.pv2auth .pv2a-field { margin: 0 0 14px; }
body.pv2auth .pv2a-labelrow { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; }
body.pv2auth .pv2a-labelrow .pv2a-flabel { margin: 0; }
body.pv2auth .pv2a-labelrow a { margin-left: auto; font-size: 11.5px; color: var(--pv2-accent); text-decoration: none; white-space: nowrap; }
body.pv2auth .pv2a-labelrow a:hover { color: var(--pv2-gold); text-decoration: none; }
body.pv2auth .pv2a-flabel {
	display: block; margin: 0 0 6px; color: var(--pv2-text-muted);
	font-family: 'Open Sans', Arial, sans-serif; font-size: 11px; font-weight: 600;
	letter-spacing: .06em; text-transform: uppercase;
}
body.pv2auth .pv2a-input {
	display: block; width: 100%; height: var(--pv2a-ctl); padding: 0 12px; margin: 0;
	background: var(--pv2-field); border: 1px solid var(--pv2-border);
	border-radius: var(--pv2-radius); color: #fff;
	font-family: 'Open Sans', Arial, sans-serif; font-size: 13px; font-weight: 400;
	box-shadow: none; transition: border-color .12s;
}
/* ONE focus indicator: the gold border the field draws for itself. No ring,
   no halo — the double-gold-border fix at the end of css/sspanel/style.css
   already clears the global :focus-visible outline for text inputs, and
   nothing here puts a second line back. */
body.pv2auth .pv2a-input:focus {
	outline: none; box-shadow: none; background: var(--pv2-field);
	border-color: var(--pv2-accent);
}
body.pv2auth .pv2a-input::placeholder { color: var(--pv2-text-dim); opacity: 1; }
/* Chrome paints its own pale autofill background over dark fields */
body.pv2auth .pv2a-input:-webkit-autofill,
body.pv2auth .pv2a-input:-webkit-autofill:hover,
body.pv2auth .pv2a-input:-webkit-autofill:focus {
	-webkit-text-fill-color: #fff;
	-webkit-box-shadow: 0 0 0 1000px var(--pv2-field) inset;
	caret-color: #fff;
}

/* ---------- buttons ---------- */
body.pv2auth .pv2a-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: var(--pv2a-ctl); padding: 0 16px; margin: 0;
	background: transparent; border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: var(--pv2-radius); color: #fff; cursor: pointer;
	font-family: 'Open Sans', Arial, sans-serif; font-size: 13px; font-weight: 400;
	line-height: 1; white-space: nowrap; text-decoration: none;
	text-shadow: none; box-shadow: none;
	transition: background-color .12s, border-color .12s;
}
body.pv2auth .pv2a-btn:hover, body.pv2auth .pv2a-btn:focus, body.pv2auth .pv2a-btn:active {
	background-color: var(--pv2-hover); color: #fff; text-decoration: none; box-shadow: none;
}
body.pv2auth .pv2a-btn.primary {
	background: var(--pv2-gold); border-color: var(--pv2-gold); color: #fff; font-weight: 600;
}
body.pv2auth .pv2a-btn.primary:hover, body.pv2auth .pv2a-btn.primary:focus, body.pv2auth .pv2a-btn.primary:active {
	background: var(--pv2-gold-deep); border-color: var(--pv2-gold-deep); color: #fff;
}
body.pv2auth .pv2a-btn.block { display: flex; width: 100%; }

/* action row under a form: primary fills, quiet link sits beside it */
body.pv2auth .pv2a-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
body.pv2auth .pv2a-actions .pv2a-btn { flex: 1 1 auto; }
body.pv2auth .pv2a-actions .pv2a-quiet { flex: 0 0 auto; }
body.pv2auth .pv2a-quiet { color: var(--pv2-text-muted); font-size: 12.5px; text-decoration: none; }
body.pv2auth .pv2a-quiet:hover { color: var(--pv2-gold); text-decoration: none; }
/* the SSO cancel controls stay <button type=button> (a submit inside a form
   with required fields pops a validation bubble on Cancel) — strip the chrome
   so they read as the quiet link they are */
body.pv2auth button.pv2a-quiet {
	background: transparent; border: 0; padding: 0; margin: 0; cursor: pointer;
	font-family: 'Open Sans', Arial, sans-serif; font-weight: 400; line-height: var(--pv2a-ctl);
	box-shadow: none; text-shadow: none;
}

/* ---------- checkbox (THE panel checkbox, mirrored for the pre-auth page) ---------- */
body.pv2auth .pv2a-check {
	display: flex; align-items: flex-start; gap: 9px; margin: 0 0 14px;
	font-size: 12.5px; line-height: 1.45; color: var(--pv2-text-muted); cursor: pointer;
}
body.pv2auth .pv2a-check input[type="checkbox"] {
	-webkit-appearance: none; appearance: none;
	width: 16px; height: 16px; margin: 1px 0 0; padding: 0; flex-shrink: 0;
	background: var(--pv2-field); border: 1px solid var(--pv2-border-strong);
	border-radius: 3px; cursor: pointer; position: relative;
	transition: background-color .12s, border-color .12s;
}
body.pv2auth .pv2a-check input[type="checkbox"]:hover { border-color: var(--pv2-accent); }
body.pv2auth .pv2a-check input[type="checkbox"]:checked { background: var(--pv2-gold); border-color: var(--pv2-gold); }
body.pv2auth .pv2a-check input[type="checkbox"]:checked:after {
	content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900;
	font-size: 10px; line-height: 1; color: #fff;
	position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
body.pv2auth .pv2a-check a { color: var(--pv2-accent); text-decoration: none; }
body.pv2auth .pv2a-check a:hover { color: var(--pv2-gold); text-decoration: none; }

/* ---------- waiting cards (login2/3/4, cancelsignup1, forgot2) ---------- */
body.pv2auth .pv2a-wait { padding: 26px 18px 28px; text-align: center; }
body.pv2auth .pv2a-wait i {
	display: block; margin: 0 auto 14px; width: 26px; height: 26px; line-height: 26px;
	color: var(--pv2-gold); font-size: 24px;
}
body.pv2auth .pv2a-wait p { margin: 0; font-size: 13px; color: var(--pv2-text-muted); }

/* the JS-only panels are display:none inline AND via the head <style>; the
   stack below them must not inherit a stray legacy margin when jQuery
   .show()s them back to display:block */
body.pv2auth .pv2a-solo + .pv2a-solo { margin-top: 20px; }

/* FA6 Free solid glyphs only exist at weight 900 — a stray weight reset
   renders every icon as a tofu box */
body.pv2auth .pv2a i.fa, body.pv2auth .pv2a i.fas, body.pv2auth .pv2a i.fa-solid { font-weight: 900 !important; }

/* ---------- Death Star: the shell has no title band, so the auth surface
   owns its own vertical rhythm and must not sit against the header ---------- */
body.pv2auth.dsv2 .pv2a { max-width: 430px; margin: 56px auto 72px; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
	body.pv2auth .pv2a { margin-top: 24px; }
	body.pv2auth .pv2a-col { flex: 1 1 100%; min-width: 0; }
}
@media (max-width: 700px) {
	/* touch sizing — same step My Account takes on phones */
	body.pv2auth { --pv2a-ctl: 44px; }
	body.pv2auth .pv2a { padding: 0 14px; margin: 20px auto 44px; }
	body.pv2auth.dsv2 .pv2a { margin: 28px auto 48px; }
	body.pv2auth .pv2a-grid { gap: 16px; }
	body.pv2auth .pv2a-cbody { padding: 16px; }
	body.pv2auth .pv2a-head h1 { font-size: 20px; }
	body.pv2auth .pv2a-actions { flex-wrap: wrap; }
	body.pv2auth .pv2a-actions .pv2a-btn { flex: 1 1 100%; }
	body.pv2auth .pv2a-actions .pv2a-quiet { flex: 1 1 100%; text-align: center; }
}
