/* =============================================================
   FREE SAMPLE — lead-magnet form
   "3 new ideas in your inbox in 10 minutes."
   All values reference design tokens (assets/css/tokens.css).
   ============================================================= */

.free-sample {
	max-width: 34rem;
	margin-inline: auto;
}

.free-sample-page__content {
	max-width: 46rem;
	margin-inline: auto;
	margin-bottom: var(--space-xl);
	text-align: center;
}

.free-sample__intro {
	text-align: center;
	margin-bottom: var(--space-xl);
}

.free-sample__heading {
	font-size: var(--text-3xl);
	margin-bottom: var(--space-sm);
}

.free-sample__description {
	color: var(--color-text-muted);
	font-size: var(--text-lg);
	margin: 0;
}

.free-sample__form {
	display: flex;
	flex-direction: column;
	gap: var(--space-lg);
	padding: var(--space-xl);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-card);
	background: var(--color-background);
	box-shadow: var(--shadow-sm);
}

.free-sample__field {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
}

.free-sample__label {
	font-family: var(--font-label);
	font-weight: var(--weight-label);
	font-size: var(--text-sm);
	color: var(--color-text);
	text-transform: capitalize;
}

.free-sample__input {
	width: 100%;
	padding: var(--space-sm) var(--space-md);
	font-family: var(--font-body);
	font-size: var(--text-base);
	color: var(--color-text);
	background: var(--color-background);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-control);
	transition: border-color var(--transition), box-shadow var(--transition);
}

.free-sample__input::placeholder {
	color: var(--color-text-muted);
}

.free-sample__input:focus-visible {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 3px var(--color-teal-100);
}

.free-sample__consent {
	display: flex;
	align-items: flex-start;
	gap: var(--space-sm);
	font-size: var(--text-sm);
	color: var(--color-text-muted);
	line-height: var(--leading-snug);
}

.free-sample__consent input {
	margin-top: 3px;
	flex-shrink: 0;
}

/* Honeypot: visually and audibly hidden, still submitted by naive bots. */
.free-sample__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* The submit button is the callout's focal point: a gift icon plus a lifted
   colour-tinted drop shadow so it reads as claiming a prize. */
.free-sample__submit {
	position: relative;
	width: 100%;
	box-shadow: 0 10px 24px -8px rgba(200, 92, 30, 0.6), 0 2px 5px rgba(12, 15, 18, 0.18);
}

.free-sample__submit:hover {
	box-shadow: 0 12px 28px -8px rgba(200, 92, 30, 0.7), 0 3px 6px rgba(12, 15, 18, 0.2);
}

.free-sample__submit[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
	box-shadow: var(--shadow-sm);
}

.free-sample__submit-gift {
	width: 1.2em;
	height: 1.2em;
	flex-shrink: 0;
}

/* Implied-consent small print beneath the submit button. */
.free-sample__smallprint {
	margin: 0;
	font-size: var(--text-xs);
	line-height: var(--leading-snug);
	color: var(--color-text-muted);
	text-align: center;
}

.free-sample__status {
	margin: 0;
	font-size: var(--text-sm);
	text-align: center;
	min-height: 1.25em;
}

/* While empty (no sending/error/success message) the status reserves no space,
   so the small print can sit tight against the form's bottom edge. */
.free-sample__status:empty {
	min-height: 0;
	display: none;
}

/* On success, hide the small print alongside the fields it referred to. */
.free-sample__form.is-success .free-sample__smallprint {
	display: none;
}

.free-sample__status[data-state="error"] {
	color: var(--color-error);
}

.free-sample__status[data-state="success"] {
	color: var(--color-success);
}

/* Success state: form contents are replaced by .free-sample__success */
.free-sample__success {
	padding: var(--space-lg);
	background: color-mix(in srgb, var(--color-primary) 8%, transparent);
	border: var(--border-width) solid color-mix(in srgb, var(--color-primary) 30%, transparent);
	border-radius: var(--radius-card);
	text-align: center;
}

.free-sample__success-title {
	font-family: var(--font-heading);
	font-weight: var(--weight-heading);
	font-size: var(--text-lg);
	color: var(--color-heading);
	margin: 0 0 var(--space-sm) 0;
}

.free-sample__success-body {
	font-size: var(--text-sm);
	color: var(--color-text-muted);
	margin: 0;
}

.free-sample__success-link {
	color: var(--brand-secondary);
	font-weight: var(--weight-label);
	text-decoration: underline;
}

.free-sample__success-link:hover {
	color: var(--brand-secondary-hover, var(--brand-secondary));
}

/* Locked website field inside the modal (URL carried in from the hero). */
.free-sample__field--website.is-locked .free-sample__input {
	background: var(--color-surface);
	color: var(--color-text-muted);
	cursor: default;
}

/* =============================================================
   "DETECTED BUSINESS" OPENGRAPH PREVIEW (shared by inline variants)
   ============================================================= */
.fs-preview {
	margin-bottom: var(--space-lg);
}

.fs-preview__label {
	font-family: var(--font-label);
	font-weight: var(--weight-label);
	font-size: var(--text-sm);
	color: var(--color-text-muted);
	margin-bottom: var(--space-2);
}

.fs-preview__card {
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-card);
	padding: var(--space-4);
	background: var(--color-background);
}

.fs-preview__row {
	display: flex;
	align-items: center;
	gap: var(--space-3);
}

.fs-preview__favicon {
	position: relative;
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	background: var(--color-surface);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

/* Globe-ish fallback ring, hidden once a real favicon loads. */
.fs-preview__favicon::before {
	content: "";
	width: 16px;
	height: 16px;
	border-radius: var(--radius-full);
	border: 2px solid var(--color-teal-300);
}

.fs-preview__favicon.has-icon::before {
	display: none;
}

.fs-preview__favicon img {
	width: 20px;
	height: 20px;
	object-fit: contain;
}

.fs-preview__meta {
	min-width: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.fs-preview__title {
	font-family: var(--font-heading);
	font-weight: var(--weight-heading);
	font-size: var(--text-base);
	color: var(--color-heading);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fs-preview__url {
	font-size: var(--text-xs);
	color: var(--color-text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fs-preview__thumb {
	flex-shrink: 0;
	width: 80px;
	height: 56px;
	object-fit: cover;
	border-radius: var(--radius-sm);
	background: var(--color-surface);
}

.fs-preview__desc {
	margin: var(--space-3) 0 0;
	font-size: var(--text-sm);
	color: var(--color-text-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.fs-preview__error {
	margin: 0;
	padding: var(--space-3) var(--space-4);
	font-size: var(--text-sm);
	color: var(--color-error);
	background: color-mix(in srgb, var(--color-error) 6%, transparent);
	border-left: 3px solid var(--color-error);
	border-radius: var(--radius-sm);
}

/* Loading skeleton. */
.fs-preview__skeleton {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-card);
	padding: var(--space-4);
}

.fs-skel-lines {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}

.fs-skel {
	display: block;
	border-radius: var(--radius-sm);
	background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-muted-bg) 37%, var(--color-surface) 63%);
	background-size: 400% 100%;
	animation: fs-shimmer 1.4s ease infinite;
}

.fs-skel--icon {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
}

.fs-skel--line {
	height: 12px;
	width: 80%;
}

.fs-skel--short {
	width: 50%;
}

@keyframes fs-shimmer {
	from { background-position: 100% 0; }
	to { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
	.fs-skel {
		animation: none;
	}
}

/* =============================================================
   INLINE OG PREVIEW VARIANTS (lab + future hero)
   Shared rule: collapsed (hidden) until a valid URL is detected,
   so there is never reserved blank space. Revealed with a small
   fade/slide so it doesn't jar the layout.
   ============================================================= */
@keyframes fs-ip-in {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes fs-ip-spin {
	to { transform: rotate(360deg); }
}

.fs-inline-preview {
	/* Pull up under the website field (the form uses a large flex gap). */
	margin-top: calc(-1 * var(--space-3));
	animation: fs-ip-in 160ms ease;
}

.fs-inline-preview[hidden] {
	display: none;
}

/* Advisory (info) vs error note — reused by all variants. */
.fs-inline-preview__note,
.fs-infield__note {
	margin: var(--space-2) 0 0;
	font-size: var(--text-sm);
	line-height: var(--leading-snug);
}

.fs-inline-preview__note[data-state="info"] {
	color: var(--color-text-muted);
}

.fs-inline-preview__note[data-state="error"] {
	color: var(--color-error);
}

/* Shared spinner (variants A + B). */
.fs-inline-spinner,
.fs-infield__spinner::before {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid var(--color-teal-200);
	border-top-color: var(--color-primary);
	border-radius: var(--radius-full);
	animation: fs-ip-spin 0.7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
	.fs-inline-preview {
		animation: none;
	}
	.fs-inline-spinner,
	.fs-infield__spinner::before {
		animation: none;
	}
}

/* Shared favicon slot for variants A + B (variant C reuses .fs-preview__*). */
.fs-inline-preview__favicon,
.fs-infield__favicon {
	position: relative;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	display: grid;
	place-items: center;
	background: var(--color-surface);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

.fs-inline-preview__favicon img,
.fs-infield__favicon img {
	width: 14px;
	height: 14px;
	object-fit: contain;
}

/* ---- Variant A: compact verified line ---- */
.fs-inline-preview--line .fs-inline-preview__loading {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-size: var(--text-sm);
	color: var(--color-text-muted);
}

.fs-inline-preview__loading[hidden] {
	display: none;
}

.fs-inline-preview__line {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-size: var(--text-sm);
	color: var(--color-text);
}

.fs-inline-preview__line[hidden] {
	display: none;
}

.fs-inline-preview__name {
	font-weight: var(--weight-label);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 24ch;
}

.fs-inline-preview__check,
.fs-infield__check {
	color: var(--color-success);
	font-weight: 700;
}

.fs-inline-preview__check[hidden],
.fs-infield__check[hidden] {
	display: none;
}

/* ---- Variant B: in-field enrichment ---- */
.fs-infield {
	position: relative;
	display: flex;
	align-items: center;
}

.fs-infield__input {
	flex: 1;
	min-width: 0;
}

/* Reserve the left slot for the favicon only once a site is detected. */
.fs-infield.is-found .fs-infield__input {
	padding-left: calc(var(--space-md) + 28px);
}

/* Reserve the right slot while loading or once found (spinner / check). */
.fs-infield.is-loading .fs-infield__input,
.fs-infield.is-found .fs-infield__input {
	padding-right: calc(var(--space-md) + 24px);
}

.fs-infield__favicon {
	position: absolute;
	left: var(--space-sm);
	display: none;
}

.fs-infield.is-found .fs-infield__favicon {
	display: grid;
}

.fs-infield__spinner,
.fs-infield__check {
	position: absolute;
	right: var(--space-sm);
	display: grid;
	place-items: center;
	width: 16px;
	height: 16px;
}

.fs-infield__spinner[hidden] {
	display: none;
}

.fs-infield__note {
	color: var(--color-success);
	font-weight: var(--weight-label);
}

.fs-infield__note[hidden] {
	display: none;
}

/* ---- Variant C: reveal-on-detect card (reuses .fs-preview__*) ---- */
.fs-inline-preview--card .fs-inline-preview__loading[hidden],
.fs-inline-preview--card .fs-preview__card[hidden] {
	display: none;
}
