/*
 * BJX admin logon (BJX-167, retokenized BJX-171).
 *
 * Standalone page: logon.html / logonDesign.html link this file only — they are
 * not part of the /admin/screen.css clump, so nothing else defines the palette.
 * Import the canonical token sheet directly (same trick admin/print.css uses) so
 * this page is built from --bjx-* tokens and inherits BOTH the prefers-color-scheme
 * dark block and the html[data-theme] override for free. Do not inline hex here.
 */
@import url(/admin/colors.css);

body {
	background: linear-gradient(180deg, var(--bjx-surface-2) 0%, var(--bjx-bg) 100%);
	min-height: 100vh;
	color: var(--bjx-text);
	font: normal 14px/1.45 system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.center {
	margin-left: auto;
	margin-right: auto;
}

.center-contents {
	text-align: center;
}

.cell {
	width: 33%;
	padding: 0;
	margin: 0;
}

/*
 * Spacer rows/cells. `height` on a table cell is already a *minimum* (CSS 2.1
 * §17.5.3) and min-height does not apply to table cells, so these cannot clip
 * their contents — and they only ever contain &nbsp;.
 */
.top-row td {
	height: 100px;
}

.middle {
	height: 310px;
	vertical-align: top;
}

.middle table {
	border-collapse: collapse;
}

.bottom-row td {
	height: 200px;
}

/* the old sliced-image frame cells: neutralized, the card styles itself */
.box-top,
.box-left,
.box-right,
.box-top-left,
.box-top-right,
.box-bottom,
.box-bottom-left,
.box-bottom-right {
	margin: 0;
	padding: 0;
	background: none;
}

.box-top,
.box-bottom {
	height: 18px;
}

.box-left {
	width: 18px;
}

.box-right,
.box-top-left,
.box-top-right,
.box-bottom-left,
.box-bottom-right {
	width: 25px;
}

/* logon card */
#logo {
	background: var(--bjx-surface);
	text-align: center;
	border: 1px solid var(--bjx-border);
	border-radius: 12px;
	box-shadow: var(--bjx-shadow-2);
	padding: 28px 32px;
}

/*
 * logo.gif is an opaque light-background bitmap; the plate is a contrasting
 * frame around it, so it must stay a dark neutral in BOTH schemes. --bjx-tooltip-bg
 * is the palette's "inverted chip" neutral (the one token defined dark-in-light-mode
 * and mid-slate-in-dark-mode), so it is the only correct token for this role.
 */
#logo img {
	background: var(--bjx-tooltip-bg);
	border: none;
	border-radius: 8px;
	padding: 10px;
	margin: 0 0 6px 0;
	max-width: 100%;
	height: auto;
}

/* overrides the #content chrome rule imported from colors.css — on this page
   #content is just the form slot inside the card, not the admin content pane. */
#content {
	color: inherit;
	background-color: transparent;
	min-height: inherit;
	margin: 12px 0 0 0;
	border: none;
	padding: 0;
}

#content table {
	padding: 2px;
	margin-left: auto;
	margin-right: auto;
}

#content table td {
	padding: 4px;
}

.input {
	text-align: left;
	margin-bottom: 10px;
}

.input div,
.input span {
	font-size: 12px;
	font-weight: 600;
	color: var(--bjx-text-2);
	margin-bottom: 3px;
}

input,
textarea,
select {
	border: 1px solid var(--bjx-border-strong);
	border-radius: var(--bjx-radius);
	padding: 6px 8px;
	font: inherit;
	font-size: 13px;
	background: var(--bjx-surface);
	color: var(--bjx-text);
}

input:focus,
textarea:focus,
select:focus {
	background-color: var(--bjx-surface);
	border: 1px solid var(--bjx-accent);
	outline: 3px solid var(--bjx-accent-ring);
	outline-offset: 0;
}

.button {
	text-align: center;
	margin-top: 8px;
	padding: 7px 16px;
	border: 1px solid transparent;
	border-radius: var(--bjx-radius);
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	transition: background-color 0.12s ease, transform 0.05s ease;
	/* logon.html hard-codes style="width:75px" on the submit button, which wraps
	   the label mid-word once padding is applied. Let padding size the control and
	   keep the old width as a floor only. */
	width: auto !important;
	min-width: 75px;
}

.enabled {
	background: var(--bjx-accent);
	color: var(--bjx-accent-contrast);
	border-style: solid;
	border-color: var(--bjx-accent);
	cursor: pointer;
	box-shadow: var(--bjx-shadow-1);
}

.enabled:hover {
	background: var(--bjx-accent-strong);
	border-color: var(--bjx-accent-strong);
}

.enabled:active {
	border-style: solid;
	transform: translateY(1px);
	box-shadow: none;
}

/*
 * Status line. logon.html hard-codes style="height:15px" on #status; an auth
 * failure message is frequently two lines and would spill out of the card, so
 * relax the fixed height to a floor.
 */
#status {
	color: var(--bjx-text-2);
	font-size: 12px;
	height: auto !important;
	min-height: 15px;
}

/*
 * Auth failure / field validation. auth.js and P4.Interface.showErrors add
 * .error (P4.Validation.ClassNames.error) to #status and to the offending
 * inputs. Every -soft fill below is paired with its solid foreground so the
 * message stays readable in dark mode (BJX-171).
 */
#status.error,
span.error,
div.error {
	color: var(--bjx-danger);
	background-color: var(--bjx-danger-soft);
	border: 1px solid var(--bjx-danger);
	border-radius: var(--bjx-radius);
	padding: 6px 10px;
	font-weight: 600;
}

input.error,
input.error:focus {
	background-color: var(--bjx-danger-soft);
	border-color: var(--bjx-danger);
	color: var(--bjx-text);
}

.oauth-divider {
	text-align: center;
	margin: 12px 0 8px 0;
	color: var(--bjx-text-3);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.google-signin {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border: 1px solid var(--bjx-border-strong);
	border-radius: var(--bjx-radius);
	background: var(--bjx-surface);
	color: var(--bjx-text);
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.google-signin:hover {
	background: var(--bjx-surface-2);
	box-shadow: var(--bjx-shadow-1);
}

.google-signin img {
	width: 18px;
	height: 18px;
	border: none;
	background: none;
	padding: 0;
	margin: 0;
}
