/*
 * pws/ebook-promo: the name, email and consent form in front of the e-book download.
 * The card, the button and the fine print keep their styles from blog-index.css; the
 * fields follow the contact form's (contact.css).
 */
.ebook-form[data-pws="ebook"] {
	margin-top: 1.5rem;
	display: grid;
	gap: 0.9rem;
	max-width: 34rem;
}

.ebook-fields[data-pws="ebook"] {
	display: grid;
	gap: 0.9rem;
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.ebook-fields[data-pws="ebook"] {
		grid-template-columns: 1fr 1fr;
	}
}

.ebook-field[data-pws="ebook"] {
	display: grid;
	gap: 0.35rem;
	align-content: start;
}

.ebook-field[data-pws="ebook"] label[data-pws="ebook"] {
	font-size: 0.88rem;
	font-weight: 500;
	color: rgb(var(--color-text));
}

.ebook-field[data-pws="ebook"] input[data-pws="ebook"] {
	width: 100%;
	background: rgb(var(--color-bg));
	color: rgb(var(--color-text));
	border: 1px solid rgb(var(--color-border));
	border-radius: var(--radius-md);
	padding: 0.65rem 0.85rem;
	font: inherit;
	/* 16px or more, so iPhone Safari does not zoom the page when a field is tapped. */
	font-size: 1rem;
}

.ebook-field[data-pws="ebook"] input[data-pws="ebook"]:focus-visible {
	outline: 2px solid rgb(var(--color-ring));
	outline-offset: 1px;
	border-color: rgb(var(--color-ring));
}

.ebook-form[data-pws="ebook"] [aria-invalid="true"] {
	border-color: rgb(var(--color-accent));
}

.ebook-err[data-pws="ebook"] {
	font-size: 0.82rem;
	color: rgb(var(--color-accent));
}

.ebook-err[data-pws="ebook"]:empty {
	display: none;
}

.ebook-consent[data-pws="ebook"] label[data-pws="ebook"] {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	font-size: 0.9rem;
	line-height: 1.5;
	color: rgb(var(--color-muted));
	cursor: pointer;
}

.ebook-consent[data-pws="ebook"] input[data-pws="ebook"] {
	flex-shrink: 0;
	width: 1.05rem;
	height: 1.05rem;
	margin-top: 0.2rem;
	accent-color: rgb(var(--color-primary));
}

.ebook-consent[data-pws="ebook"] .ebook-err[data-pws="ebook"] {
	margin-top: 0.35rem;
}

/* The link's button styles (blog-index.css), on a real button. */
.ebook-form[data-pws="ebook"] .ebook-btn[data-pws="blog-index"] {
	margin-top: 0.25rem;
	justify-self: start;
	border: 0;
	font: inherit;
	font-size: 0.95rem;
	cursor: pointer;
}

.ebook-form[data-pws="ebook"] .ebook-btn[data-pws="blog-index"]:disabled {
	opacity: 0.7;
	cursor: progress;
	transform: none;
}

.ebook-fine[data-pws="blog-index"] a[data-pws="ebook"] {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ebook-done[data-pws="ebook"] {
	padding: 1rem 1.15rem;
	border: 1px solid rgb(var(--color-border));
	border-radius: var(--radius-md);
	background: rgb(var(--color-bg));
}

.ebook-done-title[data-pws="ebook"] {
	font-family: var(--font-display);
	font-size: 1.2rem;
	color: rgb(var(--color-text));
}

.ebook-done[data-pws="ebook"] p[data-pws="ebook"] + p[data-pws="ebook"] {
	margin-top: 0.4rem;
	color: rgb(var(--color-muted));
	line-height: var(--leading-relaxed);
}

.ebook-done[data-pws="ebook"] a[data-pws="ebook"] {
	color: rgb(var(--color-text));
	text-decoration: underline;
	text-underline-offset: 2px;
}
