/*
 * /login/ account chooser (2026-10-21, docs/design/2026-10-21-login-account-chooser/03-plan.md, js/login-chooser.js).
 * Tokens are the minimal family's (css/home_minimal.css): same blue, same face as the rest of the page.
 * #login_step[data-view] is absent when this browser has no saved account, and the page is then exactly as before.
 */
.template-login {
	--lc-ink: #000000;
	--lc-body: #292929;
	--lc-meta: #5f5f5f;
	--lc-rule: #d9d6d2;
	--lc-rule-strong: #aeaaa5;
	--lc-accent: #0042ff;
	--lc-accent-dark: #002ba5;
	--lc-accent-soft: #eef3ff;
	--lc-ground: #f7f6f6;
	--lc-radius: 10px;
	--lc-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* With saved accounts the block hangs from the top instead of being centred: five rows would push it under the header */
.template-login .step-1[data-view] {
	top: clamp(84px, 13vh, 140px);
	transform: translate(-50%, 0);
	padding-bottom: 56px;
}
.template-login .step-1[data-view] h1 {
	margin-bottom: 10px;
}

/* ---- views ---------------------------------------------------------------------------------------------------- */
.template-login .acct-view {
	display: none;
}
.template-login .step-1[data-view="chooser"] .acct-view {
	display: block;
}
.template-login .step-1[data-view="chooser"] .form-view,
.template-login .step-1[data-view="password"] .google-button-wrapper,
.template-login .step-1[data-view="password"] .or,
.template-login .step-1[data-view="password"] .login-method-email,
.template-login .step-1[data-view="password"] #login_email_error,
.template-login .acct-back[hidden],
.template-login .acct-chip[hidden] {
	display: none;
}
.template-login .form-view:focus {
	outline: none;
}

.template-login .acct-view,
.template-login .acct-back,
.template-login .acct-chip {
	font-family: "Founders Grotesk", Arial, Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.template-login .acct-lede {
	margin: 10px 0 24px;
	color: var(--lc-meta);
	font-size: 17px;
	line-height: 1.35;
	text-align: center;
}

/* ---- the list ------------------------------------------------------------------------------------------------- */
.template-login .acct-list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);   /* a long address shrinks its row instead of widening the column */
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.template-login .acct-row {
	display: flex;
	align-items: center;
	gap: 4px;
	min-width: 0;
	margin: 0;
	animation: lc-in 0.24s var(--lc-ease) both;
}
/* the X hangs outside the column on wider screens, so every row lines up with the button under the list */
@media (min-width: 600px) {
	.template-login .acct-row {
		margin-right: -44px;
	}
}

.template-login .acct-pick {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 14px;
	min-width: 0;
	min-height: 66px;
	margin: 0;
	padding: 12px 16px 12px 14px;
	border: 1px solid var(--lc-rule);
	border-radius: var(--lc-radius);
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	color: var(--lc-ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, opacity 0.16s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}
.template-login .acct-pick:active {
	background: var(--lc-ground);
}
.template-login .acct-pick:focus-visible,
.template-login .acct-remove:focus-visible,
.template-login .acct-other:focus-visible,
.template-login .acct-back:focus-visible,
.template-login .acct-chip-change:focus-visible,
.template-login .acct-signup a:focus-visible {
	outline: 2px solid var(--lc-accent);
	outline-offset: 2px;
}

.template-login .acct-ico {
	display: grid;
	flex: 0 0 38px;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--lc-ground);
	color: var(--lc-body);
}
.template-login .acct-text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.template-login .acct-email,
.template-login .acct-chip-email {
	display: flex;
	min-width: 0;
	color: var(--lc-ink);
	font-size: 17px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.2px;
	white-space: nowrap;
}
/* the name gives way first; the domain never shrinks (a proportional share would clip even "@gmail.com" by a
   fraction of a pixel) and is capped instead, so it is cut only when the name is already down to a few letters.
   The cap is what keeps 2.5em of a long name: a min-width on the name would pad a short one ("maya  @…") */
.template-login .acct-local,
.template-login .acct-domain {
	overflow: hidden;
	text-overflow: ellipsis;
}
.template-login .acct-local {
	flex: 0 1 auto;
	min-width: 0;
}
.template-login .acct-domain {
	flex: 0 0 auto;
	max-width: calc(100% - 2.5em);
}
.template-login .acct-how {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--lc-meta);
	font-size: 14px;
	line-height: 1.2;
}
.template-login .acct-pill {
	padding: 3px 8px 2px;
	border-radius: 999px;
	background: var(--lc-accent-soft);
	color: var(--lc-accent);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.01em;
	white-space: nowrap;
}
.template-login .acct-go {
	display: grid;
	flex: 0 0 22px;
	place-items: center;
	color: var(--lc-meta);
	transition: transform 0.2s var(--lc-ease), color 0.16s ease;
}

.template-login .acct-remove {
	position: relative;
	display: grid;
	flex: 0 0 40px;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--lc-meta);
	cursor: pointer;
	transition: background-color 0.16s ease, color 0.16s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}
/* a 48px target around the 40px circle */
.template-login .acct-remove::before {
	content: "";
	position: absolute;
	inset: -4px;
}

@media (hover: hover) {
	.template-login .acct-pick:hover {
		border-color: var(--lc-rule-strong);
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 22px rgba(0, 0, 0, 0.07);
	}
	.template-login .acct-pick:hover .acct-go {
		color: var(--lc-ink);
		transform: translateX(3px);
	}
	.template-login .acct-remove:hover {
		background: var(--lc-ground);
		color: var(--lc-ink);
	}
	.template-login .acct-other:hover {
		background: var(--lc-ground);
	}
	.template-login .acct-back:hover,
	.template-login .acct-chip-change:hover {
		color: var(--lc-ink);
	}
	.template-login .acct-signup a:hover {
		color: var(--lc-accent-dark);
	}
}

/* leaving for Google: the chosen row spins, everything else waits */
.template-login .acct-pick.is-loading .acct-go svg {
	display: none;
}
.template-login .acct-pick.is-loading .acct-go::after {
	content: "";
	width: 18px;
	height: 18px;
	border: 2px solid var(--lc-rule);
	border-top-color: var(--lc-accent);
	border-radius: 50%;
	animation: lc-spin 0.7s linear infinite;
}
.template-login .step-1.acct-busy .acct-view {
	pointer-events: none;
}
.template-login .step-1.acct-busy .acct-pick:not(.is-loading),
.template-login .step-1.acct-busy .acct-remove,
.template-login .step-1.acct-busy .acct-other,
.template-login .step-1.acct-busy .acct-signup {
	opacity: 0.4;
}

/* ---- below the list ------------------------------------------------------------------------------------------- */
.template-login .acct-or {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 22px 0 6px;
	color: var(--lc-meta);
	font-size: 14px;
	line-height: 1;
}
.template-login .acct-or::before,
.template-login .acct-or::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--lc-rule);
}
.template-login .acct-other {
	display: block;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 15px 16px 13px;
	border: 0;
	border-radius: var(--lc-radius);
	background: transparent;
	color: var(--lc-ink);
	font: inherit;
	font-size: 17px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.16s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}
.template-login .acct-signup {
	margin: 10px 0 0;
	color: var(--lc-meta);
	font-size: 15px;
	line-height: 1.4;
	text-align: center;
}
.template-login .acct-signup a {
	color: var(--lc-accent);
	font-weight: 500;
	text-decoration: none;
	border-radius: 4px;
}
.template-login .acct-status,
.template-login .acct-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---- back from the form, and the password step's account --------------------------------------------------- */
.template-login .acct-back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 40px;
	margin: 0 0 4px -8px;
	padding: 8px 12px 6px 4px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--lc-meta);
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: color 0.16s ease;
}
.template-login .acct-back svg {
	margin-top: -2px;
}

.template-login .acct-chip {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 60px;
	margin: 24px 0 16px;
	padding: 10px 8px 10px 12px;
	border: 1px solid var(--lc-rule);
	border-radius: var(--lc-radius);
	background: #ffffff;
}
.template-login .acct-chip .acct-ico {
	flex-basis: 36px;
	width: 36px;
	height: 36px;
}
.template-login .acct-chip-email {
	flex: 1 1 auto;
}
.template-login .acct-chip-change {
	flex: 0 0 auto;
	min-height: 40px;
	padding: 8px 10px 6px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--lc-accent);
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: color 0.16s ease;
}

@keyframes lc-spin {
	to {
		transform: rotate(360deg);
	}
}
@keyframes lc-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
}
@media (prefers-reduced-motion: reduce) {
	.template-login .acct-row {
		animation: none;
	}
	.template-login .acct-pick:hover .acct-go {
		transform: none;
	}
	.template-login .acct-pick.is-loading .acct-go::after {
		animation-duration: 1.6s;
	}
}

@media (max-width: 480px) {
	.template-login .acct-lede {
		margin-bottom: 20px;
		font-size: 16px;
	}
	.template-login .acct-pick {
		gap: 11px;
		padding: 11px 10px 11px 11px;
	}
	.template-login .acct-pick .acct-ico {
		flex-basis: 34px;
		width: 34px;
		height: 34px;
	}
	.template-login .acct-go {
		flex-basis: 18px;
	}
	.template-login .acct-email,
	.template-login .acct-chip-email {
		font-size: 16px;
	}
}
