/*
 * monoLogin storefront styles. Everything is scoped to .mono-login-buttons (the sign-in buttons) and
 * .mono-login-screen / .mono-login-card (the standalone "check your email" and confirmation screens).
 *
 * Colour scheme: the buttons are light unless a host ancestor says otherwise: [data-scheme="dark"] (monoAccount),
 * or [data-scheme="auto"] to follow the visitor's system setting. The standalone screens follow the system setting.
 * Override with these custom properties on .mono-login-buttons:
 *   --ml-bg --ml-fg --ml-border --ml-hover --ml-focus --ml-line --ml-muted --ml-radius
 * Provider marks keep their own brand colours and are never recoloured.
 */

.mono-login-buttons {
	--ml-bg: #fff;
	--ml-fg: #1f1f1f;
	--ml-border: #747775;
	--ml-hover: #f2f2f2;
	--ml-focus: #0b57d0;
	--ml-line: #dadce0;
	--ml-muted: #5f6368;
	--ml-error-bg: #fce8e6;
	--ml-error-fg: #a50e0e;
	--ml-radius: 8px;
	box-sizing: border-box;
	width: 100%;
	margin: 1.25em 0 0;
}

[data-scheme="dark"] .mono-login-buttons,
.mono-login-buttons.mono-login-buttons--dark {
	--ml-bg: #131314;
	--ml-fg: #e3e3e3;
	--ml-border: #8e918f;
	--ml-hover: #1f2022;
	--ml-focus: #a8c7fa;
	--ml-line: #3c4043;
	--ml-muted: #9aa0a6;
	--ml-error-bg: #4a1c1a;
	--ml-error-fg: #f9b4ae;
}

@media (prefers-color-scheme: dark) {
	[data-scheme="auto"] .mono-login-buttons {
		--ml-bg: #131314;
		--ml-fg: #e3e3e3;
		--ml-border: #8e918f;
		--ml-hover: #1f2022;
		--ml-focus: #a8c7fa;
		--ml-line: #3c4043;
		--ml-muted: #9aa0a6;
		--ml-error-bg: #4a1c1a;
		--ml-error-fg: #f9b4ae;
	}
}

.mono-login-buttons *,
.mono-login-buttons *::before,
.mono-login-buttons *::after {
	box-sizing: border-box;
}

.mono-login-buttons__divider {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin: 0 0 1em;
	color: var(--ml-muted);
	font-size: 0.875em;
}

.mono-login-buttons__divider::before,
.mono-login-buttons__divider::after {
	content: "";
	flex: 1 1 auto;
	border-top: 1px solid var(--ml-line);
}

.mono-login-buttons__notice {
	margin: 0 0 1em;
	padding: 0.75em 1em;
	border-radius: var(--ml-radius);
	background: var(--ml-error-bg);
	color: var(--ml-error-fg);
	font-size: 0.9375em;
	line-height: 1.4;
}

.mono-login-buttons__list {
	display: flex;
	flex-direction: column;
	gap: 0.625em;
}

.mono-login-buttons--icons .mono-login-buttons__list {
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
}

.mono-login-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.75em;
	width: 100%;
	min-height: 44px;
	padding: 0.5em 1em;
	border: 1px solid var(--ml-border);
	border-radius: var(--ml-radius);
	background: var(--ml-bg);
	color: var(--ml-fg);
	font: inherit;
	font-size: 0.9375em;
	font-weight: 500;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.mono-login-button:hover {
	background: var(--ml-hover);
	color: var(--ml-fg);
	text-decoration: none;
}

.mono-login-button:focus-visible {
	outline: 3px solid var(--ml-focus);
	outline-offset: 2px;
}

.mono-login-button__icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
}

.mono-login-buttons--icons .mono-login-button {
	width: 44px;
	padding: 0;
}

.mono-login-buttons--icons .mono-login-button__label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: no-preference) {
	.mono-login-button {
		transition: background-color 0.15s ease;
	}
}

/* ------------------------------------------------------------------ standalone screens */

.mono-login-screen {
	--ml-page: #f6f7f9;
	--ml-card: #fff;
	--ml-ink: #1f2328;
	--ml-ink-muted: #59636e;
	--ml-accent: #0b57d0;
	--ml-accent-ink: #fff;
	--ml-edge: #d8dee4;
	margin: 0;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	background: var(--ml-page);
	color: var(--ml-ink);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
	.mono-login-screen {
		--ml-page: #0d1117;
		--ml-card: #161b22;
		--ml-ink: #e6edf3;
		--ml-ink-muted: #9da7b3;
		--ml-accent: #a8c7fa;
		--ml-accent-ink: #062e6f;
		--ml-edge: #30363d;
	}
}

.mono-login-card {
	box-sizing: border-box;
	width: 100%;
	max-width: 28rem;
	padding: 2rem 1.5rem;
	border: 1px solid var(--ml-edge);
	border-radius: 12px;
	background: var(--ml-card);
}

.mono-login-card__title {
	margin: 0 0 0.75rem;
	font-size: 1.375rem;
	line-height: 1.25;
}

.mono-login-card__text {
	margin: 0 0 1rem;
}

.mono-login-card__note {
	margin: 1rem 0 0;
	color: var(--ml-ink-muted);
	font-size: 0.875rem;
}

.mono-login-card__form {
	margin: 1.25rem 0 0;
}

.mono-login-card__button {
	box-sizing: border-box;
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 0.5rem 1rem;
	border: 0;
	border-radius: 8px;
	background: var(--ml-accent);
	color: var(--ml-accent-ink);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.mono-login-card__button:focus-visible,
.mono-login-card__back a:focus-visible {
	outline: 3px solid var(--ml-accent);
	outline-offset: 2px;
}

.mono-login-card__back {
	margin: 1.5rem 0 0;
	font-size: 0.875rem;
}

.mono-login-card__back a {
	color: var(--ml-accent);
}

/* "Email me a code": the two small screens. */
.mono-login-card__field {
	margin: 0 0 1rem;
}

.mono-login-card__field label {
	display: block;
	margin: 0 0 0.35rem;
	font-size: 0.9375rem;
	font-weight: 600;
}

.mono-login-card__field input {
	box-sizing: border-box;
	width: 100%;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--ml-edge);
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font: inherit;
}

.mono-login-card__field input:focus-visible {
	outline: 3px solid var(--ml-accent);
	outline-offset: 2px;
}

.mono-login-card__field input[aria-invalid="true"] {
	border-color: #d63638;
}

.mono-login-card__code {
	font-size: 1.5rem;
	letter-spacing: 0.3em;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.mono-login-card__error {
	margin: 0 0 1rem;
	padding: 0.625rem 0.75rem;
	border-left: 4px solid #d63638;
	background: rgba(214, 54, 56, 0.12);
	font-size: 0.9375rem;
}

/* The field people never see; bots fill it. Off-screen rather than display:none so simple bots still see it. */
.mono-login-card__trap {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
