/*
 * Circulation — public forms (advertising application + newsletter).
 *
 * Everything is scoped under .circ-apply so theme styles do not leak in and
 * these do not leak out. The accent colour can be changed per form with the
 * shortcode attribute accent="#hex" (sets --circ-accent).
 */

.circ-apply {
	--circ-accent: #f07d00;
	--circ-accent-deep: #b85300;
	--circ-ink: #172033;
	--circ-muted: #5f6b7d;
	--circ-line: #dfe4ec;
	--circ-soft: #f5f7fb;
	--circ-good: #0f8a4b;
	--circ-bad: #b42318;
	--circ-radius: 18px;
	--circ-tint: rgba( 240, 125, 0, .08 );
	--circ-ring: rgba( 240, 125, 0, .22 );
	max-width: 820px;
	margin: 0 auto 2.5em;
	color: var( --circ-ink );
	font-size: 16px;
	line-height: 1.55;
	text-align: left;
}

@supports ( color: color-mix( in srgb, red 50%, blue ) ) {
	.circ-apply {
		--circ-accent-deep: color-mix( in srgb, var( --circ-accent ) 76%, #000 );
		--circ-tint: color-mix( in srgb, var( --circ-accent ) 8%, #fff );
		--circ-ring: color-mix( in srgb, var( --circ-accent ) 22%, transparent );
	}
}

.circ-apply *,
.circ-apply *::before,
.circ-apply *::after {
	box-sizing: border-box;
}

.circ-apply__card {
	background: #fff;
	border: 1px solid var( --circ-line );
	border-radius: var( --circ-radius );
	box-shadow: 0 1px 2px rgba( 16, 24, 40, .04 ), 0 18px 48px -18px rgba( 16, 24, 40, .22 );
	overflow: hidden;
}

/* Hero ------------------------------------------------------------------- */
.circ-apply__hero {
	position: relative;
	padding: 40px 44px 34px;
	color: #fff;
	background: var( --circ-accent );
	background: linear-gradient( 135deg, var( --circ-accent ) 0%, var( --circ-accent-deep ) 100% );
	overflow: hidden;
	isolation: isolate;
}

.circ-apply__hero::before,
.circ-apply__hero::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: rgba( 255, 255, 255, .08 );
	z-index: -1;
}

.circ-apply__hero::before {
	width: 280px;
	height: 280px;
	right: -90px;
	top: -120px;
}

.circ-apply__hero::after {
	width: 160px;
	height: 160px;
	right: 110px;
	bottom: -110px;
}

.circ-apply__eyebrow {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	background: rgba( 255, 255, 255, .16 );
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.circ-apply .circ-apply__title {
	margin: 14px 0 8px;
	padding: 0;
	color: #fff;
	font-size: clamp( 24px, 3.4vw, 32px );
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -.01em;
	border: 0;
}

.circ-apply__lead {
	margin: 0;
	max-width: 600px;
	color: #fff;
	font-size: 16px;
}

.circ-apply__perks {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	color: rgba( 255, 255, 255, .92 );
}

.circ-apply__perks li {
	position: relative;
	margin: 0;
	padding-left: 24px;
}

.circ-apply__perks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: rgba( 255, 255, 255, .22 ) url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6.5' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E" ) center / 12px no-repeat;
}

/* Form body -------------------------------------------------------------- */
.circ-apply__form {
	margin: 0;
	padding: 8px 44px 36px;
}

.circ-apply__alert {
	margin: 24px 44px 0;
	padding: 12px 16px;
	border-radius: 12px;
	font-size: 15px;
	border: 1px solid;
}

.circ-apply__alert--error {
	color: var( --circ-bad );
	background: #fef3f2;
	border-color: #fecdca;
}

.circ-apply__alert--info,
.circ-apply__alert--success {
	color: #1b4f80;
	background: #eef4fb;
	border-color: #c2d9f0;
}

.circ-step {
	padding: 28px 0;
	border-bottom: 1px solid var( --circ-line );
}

.circ-step:last-of-type {
	border-bottom: 0;
}

.circ-step__head {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 20px;
}

.circ-step__num {
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var( --circ-tint );
	color: var( --circ-accent-deep );
	font-weight: 700;
	font-size: 15px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.circ-apply .circ-step__title {
	margin: 2px 0 2px;
	padding: 0;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	color: var( --circ-ink );
	border: 0;
}

.circ-step__hint {
	margin: 0;
	color: var( --circ-muted );
	font-size: 14px;
}

/* Choice groups ------------------------------------------------------------ */
.circ-apply .circ-group {
	margin: 0 0 22px;
	padding: 0;
	border: 0;
	min-width: 0;
}

.circ-apply .circ-group:last-child {
	margin-bottom: 0;
}

.circ-group__label {
	display: block;
	float: left;
	width: 100%;
	margin: 0 0 10px;
	padding: 0;
	font-weight: 600;
	font-size: 15px;
	color: var( --circ-ink );
}

.circ-group__label + * {
	clear: both;
}

.circ-group__sub {
	display: inline-block;
	margin-left: 6px;
	color: var( --circ-muted );
	font-weight: 400;
	font-size: 13px;
}

.circ-group__error {
	margin: 10px 0 0;
	color: var( --circ-bad );
	font-size: 14px;
}

.circ-group.is-invalid .circ-card__body {
	border-color: #f4a8a1;
}

.circ-empty-note {
	clear: both;
	margin: 0;
	padding: 14px 16px;
	border-radius: 12px;
	background: var( --circ-soft );
	color: var( --circ-muted );
	font-size: 14px;
}

.circ-cards {
	display: grid;
	gap: 12px;
}

.circ-cards--issues {
	grid-template-columns: repeat( auto-fill, minmax( 180px, 1fr ) );
}

.circ-cards--types {
	grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
}

.circ-card {
	position: relative;
	display: block;
	margin: 0;
	cursor: pointer;
	font-weight: 400;
}

.circ-card > input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.circ-card__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	height: 100%;
	padding: 14px 44px 14px 16px;
	border: 1.5px solid var( --circ-line );
	border-radius: 14px;
	background: #fff;
	transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.circ-card:hover .circ-card__body {
	border-color: var( --circ-accent );
	box-shadow: 0 6px 18px -10px rgba( 16, 24, 40, .35 );
}

.circ-card > input:focus-visible + .circ-card__body {
	box-shadow: 0 0 0 4px var( --circ-ring );
	border-color: var( --circ-accent );
}

.circ-card > input:checked + .circ-card__body {
	border-color: var( --circ-accent );
	background: var( --circ-tint );
}

.circ-card__tick {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1.5px solid var( --circ-line );
	background: #fff;
	color: transparent;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all .15s ease;
}

.circ-card > input:checked + .circ-card__body .circ-card__tick {
	background: var( --circ-accent );
	border-color: var( --circ-accent );
	color: #fff;
}

.circ-card__title {
	font-size: 16px;
	font-weight: 700;
	color: var( --circ-ink );
	line-height: 1.3;
}

.circ-card__meta {
	font-size: 14px;
	color: var( --circ-ink );
}

.circ-card__note {
	font-size: 13px;
	color: var( --circ-muted );
}

.circ-card__price {
	align-self: flex-start;
	margin-top: 6px;
	padding: 2px 10px;
	border-radius: 999px;
	background: var( --circ-tint );
	color: var( --circ-accent-deep );
	font-weight: 700;
	font-size: 14px;
}

/* Sold-out placements */
.circ-card.is-full,
.circ-card.is-unavailable {
	cursor: not-allowed;
}

.circ-card.is-full .circ-card__body,
.circ-card.is-unavailable .circ-card__body {
	background: var( --circ-soft );
	border-style: dashed;
	box-shadow: none;
}

.circ-card.is-full .circ-card__title,
.circ-card.is-unavailable .circ-card__title,
.circ-card.is-full .circ-card__tick,
.circ-card.is-unavailable .circ-card__tick {
	opacity: .5;
}

.circ-card__full {
	margin-top: 4px;
	color: var( --circ-bad );
	font-size: 13px;
	font-weight: 600;
}

.circ-card__full[hidden] {
	display: none;
}

.circ-grid--after {
	margin-top: 22px;
}

/* Text inputs ---------------------------------------------------------------- */
.circ-grid {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 16px 18px;
}

.circ-in--wide {
	grid-column: 1 / -1;
}

.circ-in label {
	display: block;
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 600;
	color: var( --circ-ink );
}

.circ-apply .circ-in input,
.circ-apply .circ-in textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 11px 14px;
	border: 1.5px solid var( --circ-line );
	border-radius: 12px;
	background: #fff;
	box-shadow: none;
	color: var( --circ-ink );
	font: inherit;
	font-size: 16px; /* 16px stops iOS from zooming on focus. */
	line-height: 1.4;
	transition: border-color .15s ease, box-shadow .15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.circ-apply .circ-in textarea {
	min-height: 0;
	resize: vertical;
}

.circ-apply .circ-in input::placeholder,
.circ-apply .circ-in textarea::placeholder {
	color: #98a2b3;
}

.circ-apply .circ-in input:hover,
.circ-apply .circ-in textarea:hover {
	border-color: #c5ccd8;
}

.circ-apply .circ-in input:focus,
.circ-apply .circ-in textarea:focus {
	outline: none;
	border-color: var( --circ-accent );
	box-shadow: 0 0 0 4px var( --circ-ring );
}

.circ-req {
	color: var( --circ-bad );
}

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

/* Footer: switches, consent, submit ------------------------------------------- */
.circ-apply__footer {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding-top: 24px;
	border-top: 1px solid var( --circ-line );
}

.circ-switch,
.circ-consent {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	font-weight: 400;
	cursor: pointer;
}

.circ-switch {
	padding: 14px 16px;
	border-radius: 14px;
	background: var( --circ-soft );
}

.circ-apply .circ-group .circ-switch + .circ-switch {
	margin-top: 8px;
}

.circ-switch > input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.circ-switch__track {
	position: relative;
	flex: 0 0 42px;
	width: 42px;
	height: 24px;
	margin-top: 1px;
	border-radius: 999px;
	background: #cdd4df;
	transition: background-color .15s ease;
}

.circ-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba( 16, 24, 40, .25 );
	transition: transform .18s ease;
}

.circ-switch > input:checked + .circ-switch__track {
	background: var( --circ-accent );
}

.circ-switch > input:checked + .circ-switch__track::after {
	transform: translateX( 18px );
}

.circ-switch > input:focus-visible + .circ-switch__track {
	box-shadow: 0 0 0 4px var( --circ-ring );
}

.circ-switch__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 14px;
	color: var( --circ-muted );
}

.circ-switch__text strong {
	color: var( --circ-ink );
	font-size: 15px;
}

.circ-consent {
	font-size: 14px;
	color: var( --circ-muted );
}

.circ-consent input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var( --circ-accent );
}

.circ-consent a {
	color: var( --circ-accent-deep );
	text-decoration: underline;
}

.circ-agreement {
	margin: -6px 0 0 30px;
	font-size: 13px;
	color: var( --circ-muted );
}

.circ-agreement summary {
	cursor: pointer;
	color: var( --circ-accent-deep );
}

.circ-agreement__text {
	max-height: 180px;
	overflow-y: auto;
	margin-top: 8px;
	padding: 10px 12px;
	border-radius: 10px;
	background: var( --circ-soft );
}

.circ-captcha {
	margin: 0;
}

.circ-apply__submit-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin-top: 4px;
}

.circ-apply__summary {
	margin: 0;
	color: var( --circ-muted );
	font-size: 14px;
}

.circ-apply__summary:empty {
	display: none;
}

.circ-apply .circ-apply__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 240px;
	min-height: 54px;
	margin: 0 0 0 auto;
	padding: 0 28px;
	border: 0;
	border-radius: 14px;
	background: var( --circ-accent );
	background: linear-gradient( 135deg, var( --circ-accent ) 0%, var( --circ-accent-deep ) 100% );
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .01em;
	text-transform: none;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 10px 24px -10px var( --circ-accent );
	transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.circ-apply .circ-apply__submit:hover {
	transform: translateY( -1px );
	box-shadow: 0 14px 28px -10px var( --circ-accent );
	color: #fff;
}

.circ-apply .circ-apply__submit:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px var( --circ-ring );
}

.circ-apply .circ-apply__submit[disabled] {
	opacity: .7;
	cursor: progress;
	transform: none;
}

.circ-apply__fineprint {
	margin: 0;
	color: var( --circ-muted );
	font-size: 13px;
	text-align: right;
}

/* Success -------------------------------------------------------------------- */
.circ-apply__done {
	padding: 48px 44px 52px;
	text-align: center;
}

.circ-apply__done-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: #e7f6ee;
	color: var( --circ-good );
	animation: circ-pop .35s ease-out both;
}

.circ-apply .circ-apply__done h3 {
	margin: 18px 0 8px;
	padding: 0;
	font-size: 24px;
	font-weight: 700;
	color: var( --circ-ink );
	border: 0;
}

.circ-apply__done p {
	max-width: 480px;
	margin: 0 auto;
	color: var( --circ-muted );
}

@keyframes circ-pop {
	from {
		transform: scale( .6 );
		opacity: 0;
	}
	to {
		transform: scale( 1 );
		opacity: 1;
	}
}

/* Compact variant (newsletter) -------------------------------------------------- */
.circ-apply--compact {
	max-width: 640px;
}

.circ-apply--compact .circ-apply__form {
	padding-top: 28px;
}

.circ-apply--compact .circ-apply__footer {
	margin-top: 24px;
}

/* Small screens ---------------------------------------------------------------- */
@media ( max-width: 640px ) {
	.circ-apply {
		margin-bottom: 1.5em;
	}

	.circ-apply__card {
		border-radius: 14px;
	}

	.circ-apply__hero {
		padding: 28px 20px 24px;
	}

	.circ-apply__lead {
		font-size: 15px;
	}

	.circ-apply__perks {
		gap: 6px 16px;
		font-size: 13px;
	}

	.circ-apply__form {
		padding: 0 20px 26px;
	}

	.circ-apply__alert {
		margin: 18px 20px 0;
	}

	.circ-step {
		padding: 22px 0;
	}

	.circ-grid {
		grid-template-columns: minmax( 0, 1fr );
		gap: 14px;
	}

	.circ-cards--issues {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}

	.circ-cards--types {
		grid-template-columns: minmax( 0, 1fr );
	}

	.circ-card__body {
		padding: 12px 36px 12px 12px;
	}

	.circ-card__tick {
		top: 10px;
		right: 10px;
	}

	.circ-apply__submit-row {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.circ-apply .circ-apply__submit {
		width: 100%;
		min-width: 0;
		margin: 0;
	}

	.circ-apply__summary,
	.circ-apply__fineprint {
		text-align: center;
	}

	.circ-apply__done {
		padding: 36px 20px 40px;
	}
}

@media ( max-width: 480px ) {
	.circ-cards--issues {
		grid-template-columns: minmax( 0, 1fr );
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.circ-apply *,
	.circ-apply *::before,
	.circ-apply *::after {
		transition: none !important;
		animation: none !important;
	}
}

/* Suspended notice shown to managers only. */
.circ-form-suspended {
	padding: 10px 14px;
	border: 1px dashed #c3c4c7;
	border-radius: 8px;
}
