/* EG Account: the signup and sign-in forms, the Account page and the dashboard. Uses the
   EnglishGrammar Textbook theme's tokens when they are there, with the same values as fallbacks. */

.ega,
.ega-form {
	--ega-ink: var(--eg-ink, #1f2c1e);
	--ega-text: var(--eg-text, #313b2f);
	--ega-muted: var(--eg-muted, #6a7267);
	--ega-tint: var(--eg-tint, #f2f7ec);
	--ega-tint-deep: var(--eg-tint-deep, #e6efdc);
	--ega-moss: var(--eg-moss, #446931);
	--ega-moss-dark: var(--eg-moss-dark, #355d20);
	--ega-moss-soft: var(--eg-moss-soft, #edf3e7);
	--ega-rule: var(--eg-rule, #e7e4da);
	--ega-rule-strong: var(--eg-rule-strong, #cfcbbf);
	--ega-border: var(--eg-panel-border, #e3e6dc);
	--ega-page: var(--eg-page, #ffffff);
	--ega-radius: var(--eg-radius, 6px);
	--ega-radius-large: var(--eg-radius-large, 12px);
	--ega-danger: #b42318;
}

.ega {
	display: grid;
	gap: 18px;
	font-family: var(--eg-sans, inherit);
	/* A long email address breaks rather than pushing a card wider than a phone's screen. */
	overflow-wrap: anywhere;
}

.ega h2 {
	margin: 0 0 10px;
	font-size: 22px;
	line-height: 1.25;
}

.ega-card {
	padding: 24px;
	border: 1px solid var(--ega-border);
	border-radius: var(--ega-radius-large);
	background: var(--ega-page);
}

.ega-card--narrow {
	max-width: 560px;
}

/* 0.2.2: a view of one card ("You're almost there", the confirm step, Sign in) is a centered column,
   so it doesn't sit in a corner of a wide page. */
.ega--single {
	width: 100%;
	max-width: 680px;
	margin-inline: auto;
}

.ega--single .ega-card--narrow {
	max-width: none;
}

@media (min-width: 700px) {
	.ega--single .ega-card {
		padding: 32px 36px;
	}
}

/* Text inside the cards at reading size, a step below the article text around them. */
.ega .ega-card p,
.ega .ega-card li,
.ega .ega-card dd {
	font-size: 16px;
	line-height: 1.55;
}

.ega .ega-card .ega-fine {
	font-size: 13.5px;
	line-height: 1.5;
}

.ega .ega-card .ega-form__intro {
	font-size: 15.5px;
}

@media (max-width: 600px) {
	.ega-card {
		padding: 18px 16px;
	}
}

.ega-columns {
	display: grid;
	gap: 18px;
}

@media (min-width: 860px) {
	.ega-columns {
		grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
		align-items: start;
	}
}

.ega-dashboard {
	display: grid;
	gap: 18px;
}

@media (min-width: 900px) {
	.ega-dashboard {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: start;
	}

	.ega-card--wide {
		grid-column: 1 / -1;
	}
}

.ega-hello {
	margin: 0;
	font-size: 18px;
	font-weight: 650;
	color: var(--ega-ink);
}

.ega-hello span {
	display: block;
	margin-top: 2px;
	color: var(--ega-muted);
	font-size: 14px;
	font-weight: 400;
}

/* Notices */

.ega-notice {
	padding: 12px 16px;
	border: 1px solid var(--ega-border);
	border-radius: var(--ega-radius);
	background: var(--ega-moss-soft);
	color: var(--ega-ink);
}

.ega-notice p {
	margin: 0;
}

.ega-notice--error {
	border-color: rgba(180, 35, 24, 0.3);
	background: rgba(180, 35, 24, 0.06);
}

/* Forms */

.ega-form {
	margin: 0;
	color: var(--ega-ink);
}

.ega-form[hidden] {
	display: none;
}

.ega-form__heading {
	margin: 0 0 6px;
	font-size: 22px;
	line-height: 1.25;
}

.ega-form__intro {
	margin: 0 0 16px;
	color: var(--ega-muted);
	font-size: 15.5px;
	line-height: 1.5;
}

.ega-fields {
	display: grid;
	gap: 0 12px;
}

@media (min-width: 560px) {
	.ega-form--signup:not(.ega-form--compact) .ega-fields {
		grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	}
}

.ega-field {
	margin: 0 0 14px;
}

.ega-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 14.5px;
	font-weight: 650;
}

.ega-optional {
	color: var(--ega-muted);
	font-weight: 400;
}

.ega-form input[type="email"],
.ega-form input[type="text"],
.ega-form input[type="password"] {
	box-sizing: border-box;
	width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--ega-rule-strong);
	border-radius: var(--ega-radius);
	background: #fff;
	color: var(--ega-ink);
	font: inherit;
	font-size: 16px;
}

.ega-form input[type="email"]:focus,
.ega-form input[type="text"]:focus,
.ega-form input[type="password"]:focus {
	border-color: var(--ega-moss);
	outline: none;
	box-shadow: 0 0 0 3px rgba(68, 105, 49, 0.2);
}

.ega-field--inline {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 8px 10px;
}

.ega-field--inline label {
	flex: 1 0 100%;
	margin: 0;
}

.ega-field--inline input[type="text"] {
	flex: 1 1 200px;
	width: auto;
}

/* The email choices */

.ega-topics {
	margin: 4px 0 16px;
	padding: 0;
	border: 0;
}

.ega-topics legend {
	margin-bottom: 8px;
	padding: 0;
	font-size: 14.5px;
	font-weight: 650;
}

.ega-topics__list {
	display: grid;
	gap: 8px;
}

@media (min-width: 560px) {
	.ega-topics__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.ega-topic {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid var(--ega-rule-strong);
	border-radius: var(--ega-radius);
	background: #fff;
	cursor: pointer;
	transition: border-color 120ms ease, background-color 120ms ease;
}

.ega-topic:hover {
	border-color: var(--ega-moss);
}

.ega-topic:has(input:checked) {
	border-color: var(--ega-moss);
	background: var(--ega-moss-soft);
}

.ega-topic input {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--ega-moss);
}

.ega-topic__text {
	display: grid;
	gap: 2px;
	line-height: 1.35;
}

.ega-topic__label {
	font-size: 15px;
	font-weight: 650;
}

.ega-topic__description {
	color: var(--ega-muted);
	font-size: 13.5px;
}

.ega-topics--compact .ega-topics__list {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px;
}

.ega-topics--compact .ega-topic {
	align-items: center;
	padding: 8px 10px;
}

.ega-topics--compact .ega-topic__label {
	font-size: 14px;
}

/* Buttons */

.ega-actions {
	margin: 0 0 12px;
}

.ega-form .ega-button,
.ega a.ega-button,
.ega-form button.ega-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	height: auto;
	padding: 10px 20px;
	border: 1px solid var(--ega-moss);
	border-radius: var(--ega-radius);
	background: var(--ega-moss);
	box-shadow: none;
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.ega-form--signup .ega-button {
	width: 100%;
}

.ega-form .ega-button:hover,
.ega a.ega-button:hover,
.ega-form .ega-button:focus-visible,
.ega a.ega-button:focus-visible {
	border-color: var(--ega-moss-dark);
	background: var(--ega-moss-dark);
	color: #fff;
}

.ega-form .ega-button:focus-visible,
.ega a.ega-button:focus-visible {
	outline: 2px solid var(--ega-moss);
	outline-offset: 2px;
}

.ega-form .ega-button[disabled] {
	opacity: 0.65;
	cursor: progress;
}

.ega-form .ega-button--secondary {
	background: #fff;
	color: var(--ega-moss-dark);
}

.ega-form .ega-button--secondary:hover,
.ega-form .ega-button--secondary:focus-visible {
	background: var(--ega-moss-soft);
	color: var(--ega-moss-dark);
}

.ega-form .ega-button--danger {
	border-color: var(--ega-danger);
	background: #fff;
	color: var(--ega-danger);
}

.ega-form .ega-button--danger:hover,
.ega-form .ega-button--danger:focus-visible {
	border-color: var(--ega-danger);
	background: var(--ega-danger);
	color: #fff;
}

/* Small print, switches and status */

.ega-fine {
	margin: 0 0 8px;
	color: var(--ega-muted);
	font-size: 13.5px;
	line-height: 1.5;
}

.ega-switch {
	margin: 4px 0 0;
	font-size: 14.5px;
}

.ega-form a,
.ega a:not(.ega-button) {
	color: var(--ega-moss-dark);
}

.ega-status {
	margin: 10px 0 0;
	font-size: 14.5px;
}

.ega-status.is-error {
	color: var(--ega-danger);
}

.ega-done {
	padding: 4px 0;
}

.ega-done:focus {
	outline: none;
}

.ega-done p {
	margin: 0 0 6px;
	font-size: 15.5px;
	line-height: 1.5;
}

.ega-done__title {
	font-size: 19px !important;
	font-weight: 750;
}

.ega-note p {
	margin: 0;
}

/* The trap field: there for bots, never shown. */
.ega-trap {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Dashboard bits */

.ega-facts {
	margin: 0 0 14px;
}

.ega-facts dt {
	font-size: 14.5px;
	font-weight: 650;
}

.ega-facts dd {
	margin: 2px 0 0;
}

.ega-signout {
	margin: 14px 0 0;
}

.ega-delete {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--ega-rule);
}

.ega-delete summary {
	color: var(--ega-muted);
	cursor: pointer;
	font-size: 14.5px;
}

.ega-delete p {
	margin: 10px 0 0;
}

.ega-check label {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	font-weight: 600;
}

/* A form drawn as a card of its own: [eg_account_signup card="1"], for a sidebar widget or a post.
   Signed-in members see the short note in the same card. */

.ega-note--card {
	--ega-moss: var(--eg-moss, #446931);
	--ega-moss-dark: var(--eg-moss-dark, #355d20);
	--ega-border: var(--eg-panel-border, #e3e6dc);
	--ega-page: var(--eg-page, #ffffff);
	--ega-radius-large: var(--eg-radius-large, 12px);
	padding: 16px 20px;
	border: 1px solid var(--ega-border);
	border-top: 4px solid var(--ega-moss);
	border-radius: var(--ega-radius-large);
	background: var(--ega-page);
	font-size: 15.5px;
	line-height: 1.5;
}

.ega-note--card a {
	color: var(--ega-moss-dark);
	font-weight: 650;
}

.ega-form--card {
	container-type: inline-size;
	padding: 22px 22px 16px;
	border: 1px solid var(--ega-border);
	border-top: 4px solid var(--ega-moss);
	border-radius: var(--ega-radius-large);
	background: var(--ega-page);
	box-shadow: 0 10px 28px -18px rgba(52, 84, 32, 0.45), 0 1px 2px rgba(31, 44, 30, 0.05);
}

@container (max-width: 330px) {
	.ega-form--card .ega-topics--compact .ega-topic {
		gap: 8px;
		padding: 8px;
	}

	.ega-form--card .ega-topics--compact .ega-topic__label {
		font-size: 13.5px;
	}
}

@media (max-width: 600px) {
	.ega-form--card {
		padding: 18px 16px 14px;
	}
}

/* 0.2.0: the benefit lines of the signup form, the label only screen readers hear, the
   "You're almost there" steps and the welcome after confirming. */

.ega-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;
}

/* 0.2.2: the signup form, top to bottom. The heading; the benefit lines, each with its tick beside
   the first line of the text; the address and the button; the small print; the sign-in link under a
   hairline. 0.2.3: in a compact form the heading scales down with the form's width (a narrow
   sidebar, a small phone), so "Free 2026 Grammar Guide" keeps to one line; a longer heading still
   wraps, evenly. */

.ega-form--compact {
	container-type: inline-size;
}

.ega-form--compact .ega-form__heading {
	color: var(--ega-ink);
	text-wrap: balance;
	font-size: 20px;
	font-size: clamp(16px, 7.6cqi, 20px);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.ega-form .ega-benefits {
	display: grid;
	gap: 10px;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
}

.ega-form__heading + .ega-benefits {
	margin-top: 12px;
}

/* Its own spacing everywhere, also in a sidebar widget (where themes draw lines and padding between
   list items): the tick and the text sit side by side, so the tick stays beside the first line. */
.ega-form .ega-benefits > li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ega-ink);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.45;
	list-style: none;
}

.ega-form .ega-benefits > li::before,
.ega-form .ega-benefits > li::after {
	content: none;
}

.ega-form .ega-benefits > li > span {
	min-width: 0;
}

.ega-form .ega-tick {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: calc((1.45em - 18px) / 2);
	margin-top: calc((1lh - 18px) / 2);
	overflow: visible;
}

.ega-tick circle {
	fill: var(--ega-tint-deep);
}

.ega-tick path {
	fill: none;
	stroke: var(--ega-moss-dark);
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ega-form--signup .ega-actions {
	margin: 0;
}

.ega-form--signup .ega-fine {
	margin: 10px 0 0;
	font-size: 13px;
	line-height: 1.5;
	text-wrap: pretty;
}

.ega-form--signup .ega-switch {
	margin: 14px 0 0;
	padding-top: 12px;
	border-top: 1px solid var(--ega-rule);
	font-size: 14px;
	text-align: center;
}

/* Cloudflare Turnstile shows only when Cloudflare needs a click; the script marks it then. */
.ega-turnstile {
	display: grid;
}

.ega-turnstile.is-shown {
	margin: 0 0 12px;
}

.ega-form--compact .ega-field {
	margin-bottom: 10px;
}

.ega .ega-card .ega-sent__to,
.ega .ega-card .ega-welcome__lead {
	margin: 0 0 14px;
	font-size: 16.5px;
}

.ega .ega-steps {
	display: grid;
	gap: 12px;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	counter-reset: ega-step;
}

.ega .ega-card .ega-steps > li {
	position: relative;
	min-height: 30px;
	margin: 0;
	padding: 3px 0 0 44px;
	line-height: 1.5;
	list-style: none;
	counter-increment: ega-step;
}

.ega-steps li::before {
	position: absolute;
	left: 0;
	top: 0;
	display: grid;
	width: 30px;
	height: 30px;
	place-items: center;
	border-radius: 50%;
	background: var(--ega-moss-soft);
	color: var(--ega-moss-dark);
	font-size: 15px;
	font-weight: 800;
	content: counter(ega-step);
}

.ega-steps--welcome li .ega-button {
	margin: 8px 0 0;
}

.ega-sent__help {
	margin: 22px 0 10px;
	font-size: 17px;
}

/* "You're almost there": the heading beside an envelope, the two steps, and the help in a soft box. */
.ega-sent__head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 16px;
}

.ega-sent__icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: var(--ega-tint-deep);
	color: var(--ega-moss-dark);
}

.ega-sent__icon svg {
	width: 26px;
	height: 26px;
}

.ega .ega-sent__head h2 {
	margin: 0;
	font-size: 26px;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.ega .ega-card.ega-sent .ega-sent__to {
	margin: 0 0 20px;
	font-size: 17px;
}

.ega .ega-sent .ega-steps {
	margin-bottom: 0;
}

.ega-sent__more {
	margin-top: 24px;
	padding: 18px 20px;
	border-radius: 10px;
	background: var(--ega-tint);
}

.ega .ega-sent__more .ega-sent__help {
	margin: 0 0 8px;
	font-size: 16px;
}

.ega .ega-card .ega-sent__more .ega-tips li {
	margin: 0 0 6px;
	font-size: 15px;
}

.ega .ega-card .ega-sent__more .ega-tips li:last-child {
	margin-bottom: 0;
}

@media (max-width: 600px) {
	.ega-sent__icon {
		width: 40px;
		height: 40px;
		border-radius: 10px;
	}

	.ega-sent__icon svg {
		width: 22px;
		height: 22px;
	}

	.ega .ega-sent__head h2 {
		font-size: 22px;
	}

	.ega-sent__more {
		padding: 14px 16px;
	}
}

.ega .ega-card .ega-tips {
	margin: 0;
	padding-left: 20px;
}

.ega .ega-card .ega-tips li {
	margin: 0 0 8px;
	font-size: 15.5px;
}

.ega a.ega-button--small {
	display: flex;
	width: max-content;
	min-height: 40px;
	padding: 8px 16px;
	font-size: 15px;
}

.ega a.ega-button--secondary {
	background: #fff;
	color: var(--ega-moss-dark);
}

.ega a.ega-button--secondary:hover,
.ega a.ega-button--secondary:focus-visible {
	background: var(--ega-moss-soft);
	color: var(--ega-moss-dark);
}

.ega-continue {
	margin: 4px 0 0;
}

/* The old [eg_optin_popup] links while EG Optin is not active (class-ega-optin-compat.php). */

.ega-optin-trigger {
	margin: 1.2em 0;
}

.ega-optin-trigger--center {
	text-align: center;
}

.ega-optin-trigger--right {
	text-align: right;
}

a.ega-optin-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 10px 22px;
	border-radius: var(--eg-radius, 6px);
	background: var(--eg-moss, #446931);
	color: #fff;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}

a.ega-optin-link:hover,
a.ega-optin-link:focus-visible {
	background: var(--eg-moss-dark, #355d20);
	color: #fff;
}

/* Building blocks for the sections other plugins add to the dashboard (filter
   eg_account_dashboard_sections): a row of actions, a text link beside a button, a progress bar
   and a "next step" box. EG Course's course section uses them. */

.ega-actions--row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 20px;
}

.ega a.ega-textlink {
	font-size: 15.5px;
	font-weight: 650;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ega-progress {
	display: grid;
	gap: 6px;
	margin: 0 0 16px;
	color: var(--ega-muted);
	font-size: 14.5px;
}

.ega-progress progress {
	width: 100%;
	height: 8px;
	border: 0;
	border-radius: 999px;
	background: var(--ega-moss-soft);
	overflow: hidden;
	-webkit-appearance: none;
	appearance: none;
}

.ega-progress progress::-webkit-progress-bar {
	border-radius: 999px;
	background: var(--ega-moss-soft);
}

.ega-progress progress::-webkit-progress-value {
	border-radius: 999px;
	background: var(--ega-moss);
}

.ega-progress progress::-moz-progress-bar {
	border-radius: 999px;
	background: var(--ega-moss);
}

.ega .ega-card .ega-next {
	display: grid;
	gap: 2px;
	margin: 0 0 16px;
	padding: 14px 16px;
	border-left: 3px solid var(--ega-moss);
	border-radius: var(--ega-radius);
	background: var(--ega-moss-soft);
}

.ega-next__label {
	color: var(--ega-moss-dark);
	font-size: 12.5px;
	font-weight: 750;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ega-next__title {
	color: var(--ega-ink);
	font-size: 17.5px;
	line-height: 1.35;
}

.ega-next__where {
	color: var(--ega-muted);
	font-size: 14px;
}

@media print {
	.ega-form,
	.ega-delete {
		display: none !important;
	}
}
