/*
 * Accounts: the sign-in panel. Plain and small on purpose.
 *
 * It takes its type and its colors from the page it sits on. A theme may set
 * any of these on .accounts-door (or on :root) to make it its own:
 *
 *   --accounts-ink     the button's words        (falls back to the page's text color)
 *   --accounts-ground  the button's fill         (falls back to none)
 *   --accounts-line    the button's edge         (falls back to the text color)
 *   --accounts-round   the button's corners      (falls back to 6px)
 *   --accounts-focus   the focus outline         (falls back to the text color)
 *   --accounts-bad     the mark beside a refusal (falls back to the text color)
 *
 * The button's own look is written to be easy for a theme to override.
 */

/* The parts sit in one column with the same space between them, whatever the theme does to a paragraph. */
.accounts-door,
.accounts-ask,
.accounts-ask form {
	display: grid;
	gap: 0.5rem;
	max-width: 26rem;
}

.accounts-door,
.accounts-ask {
	margin: 0 0 2rem;
}

/* "Ask to delete my account" stands clear of the form above it, so it is not pressed by mistake. */
.accounts-ask {
	margin-top: 2.5rem;
}

.accounts-door > p,
.accounts-ask p {
	margin: 0;
	padding: 0;
}

/* The attribute alone must hide a part, whatever the theme says about its tag. */
.accounts-door[hidden],
.accounts-door [hidden] {
	display: none !important;
}

:where(.accounts-door__btn) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 44px;
	padding: 0.6rem 1.2rem;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	color: var(--accounts-ink, inherit);
	background: var(--accounts-ground, transparent);
	border: 2px solid var(--accounts-line, currentColor);
	border-radius: var(--accounts-round, 6px);
	cursor: pointer;
}

/* The tap target is 44px tall whatever the theme's own button class does. */
.accounts-door .accounts-door__btn,
.accounts-ask .accounts-door__btn {
	min-height: 44px;
	min-width: 44px;
}

.accounts-door__btn:focus-visible,
.accounts-door__slot:focus-visible {
	outline: 3px solid var(--accounts-focus, currentColor);
	outline-offset: 3px;
}

.accounts-door__btn[disabled] {
	opacity: 0.6;
	cursor: progress;
}

/* Google's own button is drawn in here, 44px tall. */
.accounts-door__slot {
	min-height: 44px;
}

/* The message area is always on the page, so a screen reader hears a line the moment it is written. Empty, it takes no room. */
.accounts-door__msg {
	min-height: 0;
}

.accounts-door .accounts-door__msg.is-bad {
	padding-left: 0.6rem;
	font-weight: 600;
	border-left: 4px solid var(--accounts-bad, currentColor);
}

.accounts-door__note {
	font-size: 0.9em;
}

/* Nothing here moves, so there is nothing to stop for a person who asks for less motion. */

/* The second door, "Use my email": a label, a field and a button, one under the other. */
.accounts-door__email,
.accounts-door__step {
	display: grid;
	gap: 0.5rem;
}

.accounts-door__sub {
	font-weight: 600;
}

.accounts-door__input {
	box-sizing: border-box;
	width: 100%;
	min-height: 44px;
}

/* A small plain button: the colors come from the page. */
.accounts-door__link {
	min-height: 44px;
	min-width: 44px;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	background: none;
	border: 0;
	cursor: pointer;
}

.accounts-door__link:focus-visible,
.accounts-door__input:focus-visible {
	outline: 3px solid var(--accounts-focus, currentColor);
	outline-offset: 3px;
}

/* Inside an app's browser Google's button is not offered: the email part comes first, and the line about Google follows it. */
.accounts-door.is-in-app .accounts-door__email {
	order: -1;
}
