/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
:root {
	--bg: #f5f7fb;
	--surface: #ffffff;
	--text: #1c2333;
	--muted: #5b6478;
	--border-color: #e1e5ee;
	--primary: #2f5bd3;
	--primary-dark: #1d3d99;
	--available: #1f8a4c;
	--in-progress: #b26a00;
	--planned: #5b6478;
	--radius: 10px;
	--error: #c62828;
}

/* the page takes the colors of the theme the session chose, put on <body> */
.antilia-theme {
	--bg: var(--antilia-theme-surface-alt);
	--surface: var(--antilia-theme-surface);
	--text: var(--antilia-theme-text);
	--muted: color-mix(in srgb, var(--antilia-theme-text) 68%, transparent);
	--border-color: var(--antilia-theme-border);
	--primary: var(--antilia-theme-primary);
	--primary-dark: var(--antilia-theme-primary-dark);
	--on-primary: var(--antilia-theme-on-primary);
	--accent: var(--antilia-theme-accent);
	--error: var(--antilia-theme-error);
	color-scheme: var(--antilia-theme-color-scheme);
}

/*
 * The page's own fields in the daisyUI look, whose style sheet takes away the padding and the
 * corners of every field, as Tailwind does: some room and the border of the theme again. Those of
 * the components, which have classes of their own, keep theirs.
 */
.antilia-look-daisyui :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"],
	[type="color"], [type="hidden"]), textarea):not([class]) {
	padding: 0.25em 0.5em;
	border-color: var(--border-color);
	border-radius: 0.25rem;
	background: var(--surface);
}

/* the fields that failed their validation (InvalidFieldMarker); a drop-down marks its toggle */
:is(input, textarea, select, .antilia-dropdown-toggle)[aria-invalid="true"] {
	border-color: var(--error);
	box-shadow: 0 0 0 1px var(--error);
}

/* the errors of a form, listed in it: FormErrors, and Wicket's FeedbackPanel in the dialogs */
.feedbackPanel {
	margin: 0 0 12px;
	padding: 10px 14px;
	list-style: none;
	border: 1px solid color-mix(in srgb, var(--error) 45%, transparent);
	border-left-width: 4px;
	border-radius: 0.4em;
	background: color-mix(in srgb, var(--error) 8%, var(--surface));
	color: var(--text);
	font-size: 14px;
}
.feedbackPanel li + li { margin-top: 4px; }

* { box-sizing: border-box; }

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main { flex: 1; }

a { color: var(--accent, var(--primary)); }

.container {
	width: 100%;
	max-width: 1800px;
	margin: 0 auto;
	padding: 0 16px;
}

/* top bar */
.topbar {
	background: var(--surface);
	border-bottom: 1px solid var(--border-color);
}
.topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 56px;
}
.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
}
/* the logo: three cogs in the colors of the theme */
.logo { flex: none; }
.logo__cog--solid { fill: var(--primary); }
.logo__cog--outline {
	fill: none;
	stroke: var(--accent, var(--primary));
	stroke-width: 1.4;
	stroke-linejoin: round;
}
.logo__cog--toned { fill: color-mix(in srgb, var(--text) 45%, transparent); }
.logo__hub { fill: var(--primary-dark); }
.ws-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--muted);
}
.ws-status::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--planned);
}
.ws-status--live { color: var(--available); }
.ws-status--live::before { background: var(--available); }

/* hero */
.hero {
	background: linear-gradient(135deg, var(--primary-dark), var(--primary));
	color: var(--on-primary, #fff);
	padding: 56px 0 48px;
}
.hero h1 {
	margin: 0 0 8px;
	font-size: clamp(28px, 5vw, 42px);
	line-height: 1.15;
}
.hero__lead {
	margin: 0;
	max-width: 640px;
	font-size: 18px;
	opacity: .9;
}
.hero__meta {
	margin: 20px 0 0;
	font-size: 14px;
	opacity: .8;
}

.framework {
	padding: 1px 8px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--primary) 12%, transparent);
	color: var(--primary);
	font-size: 12px;
	font-weight: 600;
}

/* the invitation to sign in to try the demos */
.sign-in-hint {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 20px;
	padding: 12px 16px;
	border: 1px solid var(--border-color);
	border-left: 4px solid var(--in-progress);
	border-radius: var(--radius);
	background: var(--surface);
}
.sign-in-hint svg { flex: none; color: var(--in-progress); }
.sign-in-hint p { margin: 0; }
.sign-in-hint p + p { margin-top: 4px; }

/* which framework each component runs in */
/* room between the table and the footer */
.support-matrix__table th[scope="row"] a { color: inherit; text-decoration: none; }
.support-matrix__table th[scope="row"] a:hover { color: var(--primary); text-decoration: underline; }
.support-matrix__lead { margin: 0 0 16px; color: var(--muted); }
.support-matrix__scroll { overflow-x: auto; }
.support-matrix__table {
	width: 100%;
	border-collapse: collapse;
	background: var(--surface);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	font-size: 14px;
}
.support-matrix__table th,
.support-matrix__table td {
	padding: 8px 12px;
	border-bottom: 1px solid var(--border-color);
	text-align: center;
	white-space: nowrap;
}
.support-matrix__table th[scope="row"],
.support-matrix__table th:first-child,
.support-matrix__table td:nth-child(2) { text-align: left; }
.support-matrix__table thead th { color: var(--muted); font-weight: 600; }
.support-matrix__table tbody tr:last-child > * { border-bottom: none; }
.support { font-weight: 600; }
.support--yes { color: var(--available); }
.support--no { color: var(--muted); }

.badge {
	font-size: 12px;
	padding: 2px 8px;
	border-radius: 999px;
	border: 1px solid currentColor;
	white-space: nowrap;
}
.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.demo__title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
}

/* footer */
.footer {
	border-top: 1px solid var(--border-color);
	background: var(--surface);
	color: var(--muted);
	font-size: 13px;
}
.footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding-top: 16px;
	padding-bottom: 16px;
}

/* what runs where, and the project on GitHub */
.footer__links {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px 16px;
}
.footer__link { color: inherit; font-weight: 600; }
.footer__link:hover { color: var(--primary); }

/* demo pages */
.demo { padding-top: 24px; padding-bottom: 56px; }
.demo h1 { margin: 0 0 16px; font-size: 28px; }
/* the title of a demo, and the button opening its explanation in a dialog */
.demo__heading {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 20px;
	margin-bottom: 8px;
}
.demo .demo__heading h1 { margin: 0; }
/* the library the components of a demo are based on, below its title */
.demo__based-on {
	margin: 0 0 16px;
	color: var(--muted);
	font-size: 14px;
}
.demo__based-on a { color: inherit; font-weight: 600; }
.demo__based-on a:hover { color: var(--primary); }
.demo__about {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border: 1px solid var(--border-color);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.demo__about:hover { border-color: var(--primary); color: var(--primary); }
.demo__about:focus-visible { outline: 2px solid var(--accent, var(--primary)); outline-offset: 2px; }

/* what a demo is about, in a dialog of the home page */
.demo-details__lead { margin: 0 0 12px; font-size: 17px; }
.demo-details__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin: 0 0 16px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--border-color);
}
.demo-details__category {
	margin-right: 4px;
	color: var(--primary);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .6px;
	text-transform: uppercase;
}
.demo-details__explanation ul { padding-left: 1.2em; }
.demo-details__explanation li + li { margin-top: 6px; }
.modal-dialog-footer a.ant-button { text-decoration: none; }

/* what runs where, in a dialog of every page */
.modal-dialog-body .support-matrix__lead { margin-top: 0; }
.demo__options {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 16px;
}
a.brand { color: inherit; text-decoration: none; }

.demos { padding-top: 40px; padding-bottom: 56px; }
.demos h2 { margin: 0 0 20px; font-size: 22px; }

.hero .ws-status { color: inherit; }

/* links of a demo page to the home page and to the previous and next demo */
.demo__nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 12px;
	font-size: 14px;
}
.demo__nav a { text-decoration: none; }
.demo__nav a:hover { text-decoration: underline; }
.demo__steps { display: flex; gap: 16px; }

/* the drop-downs choosing the theme, the language and the Ajax engine */
.topbar__inner {
	gap: 16px;
}
.topbar__tools {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
}
/* the gauge slowing the session down, closer to its neighbours than they are to each other */
.topbar__throttle {
	display: flex;
	align-items: center;
	margin-inline: -6px;
}
.topbar__settings {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	font-size: 14px;
}
.topbar__setting {
	display: flex;
	align-items: center;
	gap: 6px;
}
.topbar__setting-label {
	color: var(--muted);
	font-size: 13px;
}
.topbar__setting .antilia-dropdown {
	min-width: 8.5em;
}

/* the link to sign in, and the account signed in with, which signs out */
.topbar__admin,
.topbar__sign-in,
.topbar__sign-out {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
/* the GitHub mark, linking to the project */
.topbar__github {
	display: inline-flex;
	align-items: center;
	color: inherit;
}
.topbar__github:hover,
.topbar__admin:hover,
.topbar__sign-in:hover,
.topbar__sign-out:hover { color: var(--primary); }
/* signing out is a form, sent by its button, which looks like the links beside it */
.topbar__sign-out-form {
	display: inline-flex;
	min-width: 0;
	margin: 0;
}
.topbar__sign-out {
	min-width: 0;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	line-height: inherit;
	cursor: pointer;
}
.topbar__account {
	max-width: 14em;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--muted);
	font-weight: 400;
}

/* on narrow screens the top bar wraps: the settings go below the logo, without their labels */
@media (max-width: 900px) {
	.topbar__inner {
		flex-wrap: wrap;
		height: auto;
		padding-top: 8px;
		padding-bottom: 8px;
	}
	.topbar__tools {
		flex-wrap: wrap;
		width: 100%;
		justify-content: space-between;
	}
	.topbar__settings {
		flex-wrap: wrap;
		gap: 8px;
	}
	.topbar__setting-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}
	.topbar__account {
		display: none;
	}
	/* signing in at the start, the GitHub mark at the end */
	.topbar__github { margin-left: auto; }
}

/* the sign-in page and the error pages */
.register {
	display: grid;
	place-items: start center;
	padding-top: 40px;
	padding-bottom: 56px;
}
.register__card {
	width: 100%;
	max-width: 640px;
	padding: 28px 32px;
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: 0 6px 20px rgba(28, 35, 51, .06);
}
.register__card--narrow { max-width: 420px; }
.register__form--single { grid-template-columns: 1fr; }
.register__card h1 { margin: 0 0 6px; font-size: 26px; }
.register__lead { margin: 0 0 20px; color: var(--muted); }
.register__form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 18px;
}
.register__field {
	display: grid;
	gap: 4px;
	font-size: 14px;
}
.register__field--wide,
.register__actions { grid-column: 1 / -1; }
.register__field input {
	padding: 0.4em 0.6em;
	border: 1px solid var(--border-color);
	border-radius: 0.4em;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 15px;
}
.register__field input:focus {
	outline: none;
	border-color: var(--accent, var(--primary));
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, var(--primary)) 25%, transparent);
}
.register__field .antilia-dropdown { width: 100%; font-size: 15px; }
.register__errors { grid-column: 1 / -1; }
.register__errors .feedbackPanel { margin: 0; }
/* the field robots fill in and people never see */
.register__honeypot {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.register__actions { margin: 6px 0 0; }
.register__submit {
	padding: 10px 24px;
	border: 0;
	border-radius: 999px;
	background: var(--primary);
	color: var(--on-primary, #fff);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.register__submit:hover { background: var(--primary-dark); }
.register__card--done { text-align: center; }
.register__hint { color: var(--muted); font-size: 14px; }
.register__password-hint { grid-column: 1 / -1; margin: -6px 0 0; font-size: 13px; }
.register__notice { grid-column: 1 / -1; margin: 0; }
@media (max-width: 600px) {
	.register__form { grid-template-columns: 1fr; }
	.register__card { padding: 20px; }
}

/* a password field and its eye at the end, which shows what is typed (ShowPasswordBehavior) */
.show-password {
	position: relative;
	display: grid;
}
.show-password > input { padding-right: 40px; }
/* Edge's own eye, which would stand next to this one */
.show-password > input::-ms-reveal { display: none; }
.show-password__button {
	position: absolute;
	top: 50%;
	right: 3px;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	margin-top: -16px;
	padding: 0;
	border: 0;
	border-radius: 0.4em;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
}
.show-password__button:hover { color: var(--text); }
.show-password__button:focus-visible {
	outline: 2px solid var(--accent, var(--primary));
	outline-offset: -2px;
}
.show-password__button svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
/* the password is shown: the eye in the accent color */
.show-password__button--shown,
.show-password__button--shown:hover { color: var(--accent, var(--primary)); }

/* the commit the application was built from, in demo mode (-Dwicket.demo=true) its branch too */
.footer__built {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
.build-info {
	padding: 1px 8px;
	border: 1px dashed var(--accent, var(--primary));
	border-radius: 999px;
	color: var(--accent, var(--primary));
	font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
	font-size: 12px;
}

/* registering is closed for now */
.register__closed {
	margin: 0 0 20px;
	padding: 12px 14px;
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--muted);
}
.register__submit:disabled,
.register__submit:disabled:hover {
	background: var(--border-color);
	color: var(--muted);
	cursor: not-allowed;
}

/* the captcha after too many failed attempts to sign in */
.register__captcha-lead { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.register__captcha-image a { white-space: nowrap; }
.register__captcha-image { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.register__captcha-image img { border: 1px solid var(--border-color); border-radius: var(--radius); max-width: 100%; height: auto; }

/* the account everybody shares, on the sign-in page */
.register__shared { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; }
.register__shared code { font-size: 15px; font-weight: 600; user-select: all; }

/* the administration: the sessions signed in */
.admin { padding-top: 32px; padding-bottom: 56px; }
.admin h1 { margin: 0 0 16px; font-size: 26px; }
.admin__lead { margin: 16px 0; color: var(--muted); }
.admin__sessions { border-collapse: collapse; font-size: 14px; }
.admin__sessions th,
.admin__sessions td { padding: 6px 16px 6px 0; text-align: left; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.admin__sessions th { color: var(--muted); font-weight: 600; }
