/**
 * QC Social Login buttons.
 *
 * Google: https://developers.google.com/identity/branding-guidelines
 * Apple:  https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple
 *
 * Brand colours are enforced with !important so theme link styles cannot recolour them.
 */

.qcsl {
	--qcsl-h: 40px;
	--qcsl-logo: 20px;
	--qcsl-radius: 4px;
	--qcsl-gap: 12px;
	box-sizing: border-box;
	clear: both;
	width: 100%;
	max-width: 400px;
	margin: 16px 0;
}

.qcsl *,
.qcsl *::before,
.qcsl *::after {
	box-sizing: border-box;
}

.qcsl--align-center {
	margin-inline: auto;
}

.qcsl--align-right {
	margin-inline-start: auto;
}

.qcsl--pill {
	--qcsl-radius: calc(var(--qcsl-h) / 2);
}

.qcsl__buttons {
	display: flex;
	flex-direction: column;
	gap: var(--qcsl-gap);
}

.qcsl--inline .qcsl__buttons {
	flex-flow: row wrap;
}

/* Side by side when both fit at their natural width; otherwise they wrap to full width. */
.qcsl--inline {
	max-width: 600px;
}

.qcsl--inline .qcsl-btn {
	flex: 1 1 auto;
	width: auto;
}

.qcsl--icons .qcsl__buttons {
	flex-flow: row wrap;
}

.qcsl--icons.qcsl--align-center .qcsl__buttons {
	justify-content: center;
}

.qcsl--icons.qcsl--align-right .qcsl__buttons {
	justify-content: flex-end;
}

/* Shared button shape. */
a.qcsl-btn,
span.qcsl-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-width: 140px;
	height: var(--qcsl-h);
	margin: 0;
	overflow: hidden;
	border: 1px solid transparent;
	border-radius: var(--qcsl-radius);
	box-shadow: none !important;
	font-weight: 500;
	line-height: 1;
	text-align: center;
	text-decoration: none !important;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: border-color 0.218s, box-shadow 0.218s;
}

/* State layer: 8% on hover, 12% when pressed, as Google's buttons do. */
.qcsl-btn::after {
	position: absolute;
	inset: 0;
	content: "";
	background: currentColor;
	border-radius: inherit;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.218s;
}

.qcsl-btn:hover::after {
	opacity: 0.08;
}

.qcsl-btn:active::after {
	opacity: 0.12;
}

.qcsl-btn:focus {
	outline: none;
}

.qcsl-btn:focus-visible {
	outline: 2px solid #0b57d0;
	outline-offset: 2px;
}

.qcsl-btn.is-busy {
	cursor: progress;
}

.qcsl-btn.is-busy .qcsl-btn__label {
	opacity: 0.6;
}

.qcsl-btn__label {
	overflow: hidden;
	text-overflow: ellipsis;
}

.qcsl-btn__logo,
.qcsl-btn__logo img {
	display: block;
}

.qcsl-btn__logo img {
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* Google: 12px before the logo, 10px after it, 12px after the text; Google Sans Medium 14/20. */
.qcsl-btn--google {
	padding: 0 calc(12px + var(--qcsl-logo) + 10px);
	font-family: "Google Sans", Roboto, Arial, sans-serif;
	font-size: 14px;
	letter-spacing: 0.25px;
}

.qcsl-btn--google .qcsl-btn__logo {
	position: absolute;
	top: 50%;
	inset-inline-start: 12px;
	width: var(--qcsl-logo);
	height: var(--qcsl-logo);
	transform: translateY(-50%);
}

.qcsl .qcsl-btn--google-light,
.qcsl .qcsl-btn--google-light:hover,
.qcsl .qcsl-btn--google-light:focus,
.qcsl .qcsl-btn--google-light:visited {
	background-color: #fff !important;
	border-color: #747775 !important;
	color: #1f1f1f !important;
}

.qcsl .qcsl-btn--google-dark,
.qcsl .qcsl-btn--google-dark:hover,
.qcsl .qcsl-btn--google-dark:focus,
.qcsl .qcsl-btn--google-dark:visited {
	background-color: #131314 !important;
	border-color: #8e918f !important;
	color: #e3e3e3 !important;
}

.qcsl .qcsl-btn--google-neutral,
.qcsl .qcsl-btn--google-neutral:hover,
.qcsl .qcsl-btn--google-neutral:focus,
.qcsl .qcsl-btn--google-neutral:visited {
	background-color: #f2f2f2 !important;
	border-color: #f2f2f2 !important;
	color: #1f1f1f !important;
}

/* Apple: logo artwork as tall as the button, title at 43% of the height in the system font. */
.qcsl-btn--apple {
	padding: 0 var(--qcsl-h);
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: calc(var(--qcsl-h) * 0.43);
	letter-spacing: 0;
}

.qcsl-btn--apple .qcsl-btn__logo {
	position: absolute;
	top: 0;
	bottom: 0;
	/* Inset so the Apple logo lines up with the Google logo above or below it. */
	inset-inline-start: max(0px, calc(13px + var(--qcsl-logo) / 2 - var(--qcsl-h) / 2));
	height: 100%;
	aspect-ratio: 1 / 1;
}

.qcsl .qcsl-btn--apple-black,
.qcsl .qcsl-btn--apple-black:hover,
.qcsl .qcsl-btn--apple-black:focus,
.qcsl .qcsl-btn--apple-black:visited {
	background-color: #000 !important;
	border-color: #000 !important;
	color: #fff !important;
}

.qcsl .qcsl-btn--apple-white,
.qcsl .qcsl-btn--apple-white:hover,
.qcsl .qcsl-btn--apple-white:focus,
.qcsl .qcsl-btn--apple-white:visited {
	background-color: #fff !important;
	border-color: #fff !important;
	color: #000 !important;
}

.qcsl .qcsl-btn--apple-outline,
.qcsl .qcsl-btn--apple-outline:hover,
.qcsl .qcsl-btn--apple-outline:focus,
.qcsl .qcsl-btn--apple-outline:visited {
	background-color: #fff !important;
	border-color: #000 !important;
	color: #000 !important;
}

/* Logo-only buttons: square (circular when pill-shaped). */
a.qcsl-btn--icon,
span.qcsl-btn--icon {
	flex: 0 0 var(--qcsl-h);
	width: var(--qcsl-h);
	min-width: 0;
	padding: 0;
}

.qcsl-btn--icon .qcsl-btn__logo {
	position: static;
	transform: none;
}

.qcsl-btn--apple.qcsl-btn--icon .qcsl-btn__logo {
	height: 100%;
}

.qcsl-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* "or" divider. */
.qcsl__or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 16px 0;
	font-size: 13px;
	line-height: 1;
	opacity: 0.75;
}

.qcsl__or::before,
.qcsl__or::after {
	flex: 1;
	height: 1px;
	content: "";
	background: currentColor;
	opacity: 0.35;
}

/* Messages after a sign-in attempt. */
.qcsl__notice {
	margin: 0 0 12px;
	padding: 10px 12px;
	border-inline-start: 4px solid #d63638;
	border-radius: 2px;
	background: #fcf0f1;
	color: #1d2327;
	font-size: 14px;
	line-height: 1.45;
}

.qcsl__notice--success {
	border-color: #00a32a;
	background: #edfaef;
}

.qcsl__legal {
	margin: 12px 0 0;
	font-size: 12px;
	line-height: 1.5;
	opacity: 0.8;
}

/* wp-login.php: padding, not margin, because clearing the floated Log In button swallows a top margin. */
.login .qcsl {
	margin: 0 0 4px;
	padding-top: 20px;
}

.login .qcsl__or {
	margin-top: 0;
}

/* Connected accounts list. */
.qcsl-connect {
	--qcsl-h: 40px;
	--qcsl-logo: 20px;
	max-width: 600px;
	margin: 0 0 24px;
}

.qcsl-connect .qcsl__notice {
	margin-bottom: 8px;
}

ul.qcsl-connect__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

li.qcsl-connect__item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 16px;
	margin: 0;
	padding: 16px 0;
	border-bottom: 1px solid rgba(128, 128, 128, 0.25);
}

.qcsl-connect__info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.qcsl-connect__status {
	font-size: 0.9em;
	opacity: 0.8;
	overflow-wrap: anywhere;
}

.qcsl-connect__item .qcsl {
	flex: 0 1 260px;
	width: auto;
	margin: 0;
}

.qcsl-connect__action {
	flex: none;
}

@media (prefers-reduced-motion: reduce) {
	.qcsl-btn,
	.qcsl-btn::after {
		transition: none;
	}
}

@media (forced-colors: active) {
	.qcsl-btn {
		border: 1px solid ButtonText !important;
	}
}
