/*
	Biffin Boy's Rage of Mages 2 pages: sign-up (rom2/register.html), status (rom2/status.html)
	and the admin page (admin/rom2.html). Sits on top of main.css and dark.css.
*/

.rom2-panel p:last-child { margin-bottom: 0; }

.rom2-intro { max-width: 46em; }

/* Plain-text password warning */
.rom2-warning {
	margin: 0 0 2em 0;
	padding: 1em 1.25em 1em 1.25em;
	border-left: solid 6px #e0a43b;
	border-radius: 8px;
	background: #fdf5e6;
	color: #5d4a22;
}
.rom2-warning strong { color: #4a3a15; }

.rom2-notice {
	margin: 0 0 2em 0;
	padding: 1em 1.25em;
	border-radius: 8px;
	background: #f2f5f3;
}

.rom2-success {
	padding: 1.5em;
	border-radius: 8px;
	border-left: solid 6px #43a032;
	background: #eef7ec;
}
.rom2-success h3 { margin-bottom: 0.5em; }

[hidden] { display: none !important; }

/* Form */
#reg-form label { margin-bottom: 0.5em; }
.rom2-optional { text-transform: none; font-weight: 400; font-family: "Open Sans", sans-serif; font-size: 0.85em; }
.rom2-hint { margin: 0.4em 0 0 0; font-size: 0.85em; color: #7c8681; line-height: 1.5; }
.rom2-error { margin: 0.4em 0 0 0; min-height: 1.2em; font-size: 0.9em; font-weight: 700; color: #c0392b; line-height: 1.4; }
.rom2-error:empty { min-height: 0; }
#reg-form input[aria-invalid="true"] { border-color: #e57d72; }
#reg-form .rom2-field { margin-bottom: 1.5em; }
#reg-turnstile { min-height: 65px; margin: 0.5em 0 0 0; }
#reg-form input[type="submit"][disabled] { opacity: 0.6; cursor: wait; }
.rom2-steps li { margin-bottom: 0.5em; }

/* Status */
.rom2-status {
	display: flex;
	align-items: center;
	gap: 1em;
	padding: 1.25em 1.5em;
	border-radius: 8px;
	background: #f2f5f3;
	margin: 0 0 2em 0;
}
.rom2-dot {
	flex: 0 0 auto;
	width: 1.1em;
	height: 1.1em;
	border-radius: 50%;
	background: #a1aaa5;
	box-shadow: 0 0 0 5px rgba(161, 170, 165, 0.25);
}
.rom2-status[data-state="online"] .rom2-dot { background: #43a032; box-shadow: 0 0 0 5px rgba(67, 160, 50, 0.25); }
.rom2-status[data-state="offline"] .rom2-dot { background: #d9534f; box-shadow: 0 0 0 5px rgba(217, 83, 79, 0.25); }
.rom2-status-title { margin: 0; font-size: 1.4em; font-weight: 700; line-height: 1.3; }
.rom2-status-sub { margin: 0.2em 0 0 0; color: #7c8681; font-size: 0.95em; line-height: 1.4; }

ul.rom2-servers { list-style: none; padding: 0; margin: 0 0 1.5em 0; }
ul.rom2-servers li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4em 1em;
	padding: 0.75em 0;
	border-top: solid 1px #e7eae8;
}
ul.rom2-servers li:first-child { border-top: 0; }
.rom2-server-name { font-weight: 700; flex: 1 1 12em; }
.rom2-server-addr { font-family: monospace; font-size: 0.95em; color: #6b7770; }
.rom2-muted { color: #a1aaa5; font-style: italic; }

.rom2-badge {
	display: inline-block;
	padding: 0.1em 0.7em;
	border-radius: 1em;
	font-size: 0.8em;
	font-weight: 700;
	line-height: 1.6;
	white-space: nowrap;
	background: #e7eae8;
	color: #4b5550;
}
.rom2-badge.is-up, .rom2-badge.is-active { background: #dff0db; color: #2c6e20; }
.rom2-badge.is-down, .rom2-badge.is-failed, .rom2-badge.is-rejected { background: #f8dedc; color: #8f2a22; }
.rom2-badge.is-pending, .rom2-badge.is-approved, .rom2-badge.is-delivering, .rom2-badge.is-written { background: #fbefd5; color: #6e5212; }

/* Admin */
.rom2-table-wrap { overflow-x: auto; margin: 0 0 2em 0; }
table.rom2-table { width: 100%; border-collapse: collapse; font-size: 0.95em; }
table.rom2-table th, table.rom2-table td { padding: 0.6em 0.75em; border-bottom: solid 1px #e7eae8; text-align: left; vertical-align: top; }
table.rom2-table th { font-family: "Open Sans Condensed", sans-serif; text-transform: uppercase; color: #6b7770; white-space: nowrap; }
table.rom2-table td.rom2-actions { white-space: nowrap; }
table.rom2-table td.rom2-msg { font-family: monospace; font-size: 0.9em; word-break: break-word; max-width: 28em; }
table.rom2-table .button { padding: 0.45em 1em; font-size: 0.9em; margin: 0 0.3em 0.3em 0; }
.rom2-admin-bar { display: flex; flex-wrap: wrap; gap: 1em; align-items: center; justify-content: space-between; margin: 0 0 1.5em 0; }
.rom2-admin-bar p { margin: 0; }

/* ---------- Dark mode ---------- */
html[data-theme="dark"] .rom2-warning { background: #33291a; color: #ecd9b0; border-left-color: #d79a2c; }
html[data-theme="dark"] .rom2-warning strong { color: #ffe4ad; }
html[data-theme="dark"] .rom2-notice,
html[data-theme="dark"] .rom2-status { background: #23272a; }
html[data-theme="dark"] .rom2-success { background: #1d2b1b; border-left-color: #5cb84b; }
html[data-theme="dark"] .rom2-hint,
html[data-theme="dark"] .rom2-status-sub { color: #a3aba6; }
html[data-theme="dark"] .rom2-error { color: #ff8f84; }
html[data-theme="dark"] .rom2-server-addr { color: #b5bdb8; }
html[data-theme="dark"] ul.rom2-servers li,
html[data-theme="dark"] table.rom2-table th,
html[data-theme="dark"] table.rom2-table td { border-color: #34393c; }
html[data-theme="dark"] table.rom2-table th { color: #a3aba6; }
html[data-theme="dark"] .rom2-badge { background: #34393c; color: #d6d9d7; }
html[data-theme="dark"] .rom2-badge.is-up, html[data-theme="dark"] .rom2-badge.is-active { background: #24401f; color: #a6e39a; }
html[data-theme="dark"] .rom2-badge.is-down, html[data-theme="dark"] .rom2-badge.is-failed, html[data-theme="dark"] .rom2-badge.is-rejected { background: #4a2420; color: #ffb3aa; }
html[data-theme="dark"] .rom2-badge.is-pending, html[data-theme="dark"] .rom2-badge.is-approved,
html[data-theme="dark"] .rom2-badge.is-delivering, html[data-theme="dark"] .rom2-badge.is-written { background: #45391c; color: #f3d898; }

@media screen and (max-width: 736px) {
	table.rom2-table { min-width: 640px; }   /* scroll sideways on phones instead of squashing columns */
}

/* Status page: live server table (like the Hat's list); cards on phones */
table.rom2-live td { vertical-align: middle; }
table.rom2-live .rom2-server-addr { font-size: 0.85em; }
@media screen and (max-width: 736px) {
	.rom2-live-wrap { overflow-x: visible; }
	table.rom2-live { min-width: 0; }
	table.rom2-live thead { display: none; }
	table.rom2-live, table.rom2-live tbody, table.rom2-live tr, table.rom2-live td { display: block; width: 100%; }
	table.rom2-live tr { margin: 0 0 1em 0; padding: 0.75em 1em; border: solid 1px #e7eae8; border-radius: 8px; }
	table.rom2-live td { display: flex; justify-content: space-between; gap: 1em; padding: 0.3em 0; border: 0; text-align: right; }
	table.rom2-live td::before { content: attr(data-label); font-weight: 700; color: #6b7770; text-align: left; }
	table.rom2-live td.rom2-live-name { display: block; text-align: left; font-size: 1.1em; padding-bottom: 0.5em; }
	table.rom2-live td.rom2-live-name::before, table.rom2-live td[colspan]::before { content: none; }
	table.rom2-live td[colspan] { display: block; text-align: left; }
	html[data-theme="dark"] table.rom2-live tr { border-color: #34393c; }
	html[data-theme="dark"] table.rom2-live td::before { color: #a3aba6; }
}

/* Logins are saved in lower case (redhat Hat); show them that way while typing. */
/* sign-up: live login feedback and the rules box */
.rom2-ok { margin: 0.2em 0 0 0; min-height: 1.2em; font-size: 0.9em; line-height: 1.4; }
.rom2-ok.is-free { color: #2e7d32; font-weight: 700; }
.rom2-ok.is-note { color: #5f6b66; }
html[data-theme="dark"] .rom2-ok.is-free { color: #7fd48a; }
html[data-theme="dark"] .rom2-ok.is-note { color: #aab4af; }
.rom2-rules { margin: 0 0 1.5em 0; padding: 0.8em 1.1em; border-left: 4px solid #4c8a5a; background: rgba(76, 138, 90, 0.08); }
.rom2-rules h3 { margin: 0 0 0.3em 0; font-size: 1em; }
.rom2-rules ul { margin: 0; padding-left: 1.1em; }
.rom2-rules li { margin: 0.15em 0; }
html[data-theme="dark"] .rom2-rules { background: rgba(127, 212, 138, 0.08); border-left-color: #7fd48a; }

/* admin: ban / mute timing notes */
.rom2-note { margin: -0.5em 0 1.5em 1.25em; font-size: 0.9em; }
.rom2-note li { margin-bottom: 0.3em; }

/* Prominent "don't reuse your password" callout (register + guide pages). */
.rom2-warning-strong { border: solid 2px #c9302c; border-left-width: 8px; background: #fdecea; color: #4d1714; }
.rom2-warning-strong p { margin: 0 0 0.4em 0; }
.rom2-warning-strong p:last-child { margin-bottom: 0; }
.rom2-warning-title { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; font-size: 1.05em; color: #8f1d17; }
.rom2-warning-title::before { content: "\26A0\FE0F  "; text-decoration: none; display: inline-block; margin-right: 0.35em; }
html[data-theme="dark"] .rom2-warning-strong { background: #3a1d1b; color: #f6d7d3; border-color: #e0605a; }
html[data-theme="dark"] .rom2-warning-title { color: #ffb4ad; }
