/*
 * OUTDURO Sticker Challenge form ([osc_form]). Mobile first; inherits the theme's typography and
 * WoodMart's CSS variables, with the OUTDURO palette (ink #0F0F0F, sand #D2A66C, paper #F2EFE8) as
 * fallback. Original sticker artwork is never filtered, recoloured or cropped: the selected state is a
 * border, a check badge and aria-pressed.
 */
.osc {
	--osc-ink: var(--wd-title-color, #0f0f0f);
	--osc-text: var(--wd-text-color, #2b2b28);
	--osc-muted: #6a6a60;
	--osc-accent: var(--wd-primary-color, #d2a66c);
	--osc-accent-ink: #7a5c34;
	--osc-paper: #f2efe8;
	--osc-line: #dcd7cb;
	--osc-error: #b3261e;
	--osc-ok: #2f6b3a;
	--osc-radius: var(--wd-brd-radius, 4px);

	color: var(--osc-text);
	margin: 0 auto;
	max-width: 880px;
	scroll-margin-top: 90px;
}

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

.osc [hidden] {
	display: none !important;
}

.osc__header {
	margin-bottom: 24px;
}

.osc__title {
	color: var(--osc-ink);
	margin: 0 0 12px;
}

.osc__lead {
	font-size: 1.05em;
	margin: 0 0 8px;
}

.osc__state,
.osc__correction {
	background: var(--osc-paper);
	border-left: 4px solid var(--osc-accent);
	margin: 0 0 24px;
	padding: 16px 18px;
}

.osc__state-text {
	color: var(--osc-ink);
	font-size: 1.1em;
	font-weight: 600;
	margin: 0;
}

.osc__correction p {
	margin: 0 0 8px;
}

.osc__note {
	background: #fff;
	border-left: 3px solid var(--osc-accent);
	margin: 8px 0 0;
	padding: 10px 14px;
	white-space: pre-line;
}

/* ---------- Layout ---------- */

.osc-form {
	display: grid;
	gap: 28px;
}

.osc-form__deadline {
	color: var(--osc-accent-ink);
	font-weight: 600;
	margin: 0;
}

.osc-form__deadline:empty {
	display: none;
}

.osc-form__summary {
	background: #fdecea;
	border-left: 4px solid var(--osc-error);
	color: var(--osc-error);
	font-weight: 600;
	padding: 12px 16px;
}

.osc-group {
	border: 0;
	margin: 0;
	min-width: 0;
	padding: 0;
}

.osc-group--person {
	display: grid;
	gap: 16px;
}

@media (min-width: 640px) {
	.osc-group--person {
		grid-template-columns: 1fr 1fr;
	}
}

.osc-legend,
.osc-field > label {
	color: var(--osc-ink);
	display: block;
	float: none;
	font-size: 1.05em;
	font-weight: 700;
	line-height: 1.35;
	margin: 0 0 10px;
	padding: 0;
	width: auto;
}

.osc-req {
	color: var(--osc-error);
}

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

.osc-field input[type="text"],
.osc-field input[type="email"] {
	font-size: 16px; /* No zoom on iOS. */
	min-height: 48px;
	width: 100%;
}

/* Visible focus on the text fields (WCAG 2.4.7): the theme removes the outline. */
.osc .osc-field input[type="text"]:focus-visible,
.osc .osc-field input[type="email"]:focus-visible,
.osc .osc-consent input[type="checkbox"]:focus-visible {
	border-color: var(--osc-ink);
	box-shadow: 0 0 0 1px var(--osc-ink);
	outline: 3px solid var(--osc-accent);
	outline-offset: 2px;
}

.osc-field.is-invalid input[type="text"],
.osc-field.is-invalid input[type="email"] {
	border-color: var(--osc-error);
}

.osc-field__error {
	color: var(--osc-error);
	font-size: 0.95em;
	font-weight: 600;
	margin: 8px 0 0;
}

.osc-field__error::before {
	content: "⚠ ";
}

.osc-note {
	background: var(--osc-paper);
	margin: 12px 0 0;
	padding: 10px 14px;
}

/* ---------- Shared check badge ---------- */

.osc-check {
	align-items: center;
	background: #fff;
	border: 2px solid var(--osc-line);
	border-radius: 50%;
	display: inline-flex;
	height: 28px;
	justify-content: center;
	position: absolute;
	right: 8px;
	top: 8px;
	width: 28px;
}

.is-selected > .osc-check,
.osc-location input:checked ~ .osc-check,
.osc-sticker[aria-pressed="true"] > .osc-check {
	background: var(--osc-ink);
	border-color: var(--osc-ink);
}

.is-selected > .osc-check::after,
.osc-location input:checked ~ .osc-check::after,
.osc-sticker[aria-pressed="true"] > .osc-check::after {
	border: solid #fff;
	border-width: 0 3px 3px 0;
	content: "";
	height: 12px;
	margin-top: -3px;
	transform: rotate(45deg);
	width: 7px;
}

/* ---------- Location cards ---------- */

.osc-locations {
	display: grid;
	gap: 12px;
}

@media (min-width: 640px) {
	.osc-locations {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.osc-location {
	background: #fff;
	border: 2px solid var(--osc-line);
	border-radius: var(--osc-radius);
	cursor: pointer;
	display: block;
	margin: 0;
	min-height: 100%;
	padding: 16px 44px 16px 16px;
	position: relative;
	transition: border-color 0.15s ease;
}

.osc-location input {
	height: 1px;
	opacity: 0;
	position: absolute;
	width: 1px;
}

.osc-location:hover {
	border-color: var(--osc-muted);
}

.osc-location:has(input:checked),
.osc-location.is-selected {
	border-color: var(--osc-ink);
	box-shadow: inset 0 0 0 1px var(--osc-ink);
}

.osc-location:has(input:focus-visible) {
	outline: 3px solid var(--osc-accent);
	outline-offset: 2px;
}

.osc-location__body {
	display: grid;
	gap: 6px;
}

.osc-location__icon {
	color: var(--osc-ink);
	display: block;
	line-height: 0;
}

.osc-location__title {
	color: var(--osc-ink);
	font-weight: 700;
	line-height: 1.3;
}

.osc-location__hint {
	color: var(--osc-muted);
	font-size: 0.9em;
	line-height: 1.35;
}

.osc-field.is-invalid .osc-location {
	border-color: var(--osc-error);
}

/* ---------- Sticker cards ---------- */

.osc-stickers {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 480px) {
	.osc-stickers {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 800px) {
	.osc-stickers {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.osc .osc-sticker {
	align-items: center;
	background: #fff;
	border: 2px solid var(--osc-line);
	border-radius: var(--osc-radius);
	box-shadow: none;
	color: var(--osc-ink);
	cursor: pointer;
	display: flex;
	flex-direction: column;
	font: inherit;
	gap: 8px;
	height: auto;
	justify-content: flex-start;
	letter-spacing: normal;
	line-height: 1.25;
	margin: 0;
	min-height: 0;
	padding: 14px 10px 12px;
	position: relative;
	text-align: center;
	text-transform: none;
	transition: border-color 0.15s ease;
	white-space: normal;
}

.osc .osc-sticker:hover {
	background: #fff;
	border-color: var(--osc-muted);
	color: var(--osc-ink);
}

.osc .osc-sticker[aria-pressed="true"] {
	background: var(--osc-paper);
	border-color: var(--osc-ink);
	box-shadow: inset 0 0 0 1px var(--osc-ink);
}

.osc .osc-sticker:focus-visible {
	outline: 3px solid var(--osc-accent);
	outline-offset: 2px;
}

.osc-sticker__art {
	align-items: center;
	aspect-ratio: 1;
	display: flex;
	justify-content: center;
	width: 100%;
}

/* Natural proportions, whole sticker visible, no filters. */
.osc-sticker__img {
	height: auto;
	max-height: 100%;
	max-width: 100%;
	object-fit: contain;
	width: auto;
}

.osc-sticker__name {
	font-size: 0.92em;
	font-weight: 700;
}

.osc-field.is-invalid .osc-sticker {
	border-color: var(--osc-error);
}

/* ---------- Progress ---------- */

.osc-progress {
	margin-top: 16px;
}

.osc-progress__label {
	color: var(--osc-ink);
	font-weight: 700;
	margin: 0 0 8px;
}

.osc-progress__bar {
	background: var(--osc-line);
	border-radius: 999px;
	height: 10px;
	overflow: hidden;
}

.osc-progress__fill {
	background: var(--osc-ink);
	display: block;
	height: 100%;
	transition: width 0.25s ease;
	width: 0;
}

.osc.is-complete .osc-progress .osc-progress__fill {
	background: var(--osc-accent);
}

.osc-progress__complete {
	color: var(--osc-accent-ink);
	font-weight: 700;
	margin: 10px 0 0;
}

.osc-progress__complete::before {
	content: "★ ";
}

/* ---------- Prize preview ---------- */

.osc-prizes {
	background: var(--osc-ink);
	border-radius: var(--osc-radius);
	color: #eeece6;
	padding: 18px 18px 14px;
}

.osc-prizes__title {
	color: var(--osc-accent);
	font-size: 1.1em;
	letter-spacing: 0.04em;
	margin: 0 0 12px;
	text-transform: uppercase;
}

.osc-prizes__list {
	display: grid;
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.osc-prize {
	align-items: center;
	display: flex;
	gap: 12px;
	margin: 0;
}

.osc-prize__img {
	background: #fff;
	border-radius: var(--osc-radius);
	flex: 0 0 64px;
	height: 64px;
	object-fit: contain;
	width: 64px;
}

.osc-prize__body {
	display: grid;
	gap: 2px;
}

.osc-prize__count {
	color: var(--osc-accent);
	font-size: 0.85em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.osc-prize__name {
	color: #fff;
	font-weight: 700;
}

.osc-prize__meta {
	color: #a9a597;
	font-size: 0.9em;
}

.osc-prizes__note {
	color: #a9a597;
	font-size: 0.88em;
	margin: 12px 0 0;
}

/* ---------- How-to + examples ---------- */

.osc-howto {
	background: var(--osc-paper);
	border-radius: var(--osc-radius);
	padding: 18px;
}

.osc-howto__title {
	color: var(--osc-ink);
	margin: 0 0 10px;
}

.osc-howto p {
	margin: 0 0 8px;
}

.osc-examples {
	display: grid;
	gap: 12px;
	margin-top: 12px;
}

@media (min-width: 640px) {
	.osc-examples {
		grid-template-columns: 1fr 1fr;
	}
}

.osc-example {
	margin: 0;
}

.osc-example img {
	display: block;
	height: auto;
	width: 100%;
}

.osc-example figcaption {
	font-size: 0.88em;
	margin-top: 6px;
}

.osc-example__badge {
	background: var(--osc-ink);
	color: #fff;
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.08em;
	padding: 2px 6px;
	text-transform: uppercase;
}

/* ---------- Uploads ---------- */

.osc-upload__help {
	color: var(--osc-muted);
	font-size: 0.92em;
	margin: -4px 0 10px;
}

.osc-drop {
	align-items: center;
	background: #fff;
	border: 2px dashed var(--osc-line);
	border-radius: var(--osc-radius);
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 18px 14px;
	text-align: center;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.osc-drop.is-dragging {
	background: var(--osc-paper);
	border-color: var(--osc-ink);
}

.osc-field.is-invalid .osc-drop {
	border-color: var(--osc-error);
}

.osc-drop__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.osc .osc-drop__button {
	align-items: center;
	background: var(--osc-ink);
	border-radius: var(--osc-radius);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	font-weight: 700;
	margin: 0;
	min-height: 48px;
	padding: 10px 18px;
}

.osc .osc-drop__button--camera {
	background: transparent;
	border: 2px solid var(--osc-ink);
	color: var(--osc-ink);
}

/* Visually hidden but focusable through its label. */
.osc-file {
	height: 1px;
	opacity: 0;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.osc-file:focus-visible + .osc-drop__button,
.osc-drop__button:has(+ .osc-file:focus-visible) {
	outline: 3px solid var(--osc-accent);
	outline-offset: 2px;
}

.osc-drop__hint {
	color: var(--osc-muted);
	font-size: 0.88em;
	margin: 0;
}

@media (hover: none) {
	.osc-drop__hint {
		display: none;
	}
}

@media (hover: hover) {
	.osc .osc-drop__button--camera,
	.osc .osc-drop__button--camera + .osc-file {
		display: none;
	}
}

.osc-upload--main.has-files .osc-drop {
	display: none;
}

.osc-previews {
	display: grid;
	gap: 10px;
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
}

.osc-previews:empty {
	display: none;
}

.osc-preview {
	align-items: center;
	background: #fff;
	border: 1px solid var(--osc-line);
	border-radius: var(--osc-radius);
	display: grid;
	gap: 12px;
	grid-template-columns: 72px 1fr;
	margin: 0;
	padding: 8px;
}

.osc-upload--main .osc-preview {
	grid-template-columns: 1fr;
}

.osc-preview__thumb {
	align-items: center;
	background: var(--osc-paper);
	color: var(--osc-muted);
	display: flex;
	font-weight: 700;
	height: 72px;
	justify-content: center;
	overflow: hidden;
	width: 72px;
}

.osc-upload--main .osc-preview__thumb {
	height: auto;
	max-height: 360px;
	min-height: 120px;
	width: 100%;
}

.osc-preview.is-converting .osc-preview__thumb {
	animation: osc-pulse 1.2s ease-in-out infinite alternate;
	font-size: 0.75em;
	font-weight: 400;
	padding: 4px;
	text-align: center;
}

@keyframes osc-pulse {
	to { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
	.osc-preview.is-converting .osc-preview__thumb {
		animation: none;
	}
}

.osc-preview__thumb img {
	height: 100%;
	max-height: 360px;
	object-fit: contain;
	width: 100%;
}

.osc-preview__meta {
	font-size: 0.9em;
	overflow-wrap: anywhere;
}

.osc-preview__actions {
	display: flex;
	gap: 16px;
	grid-column: 1 / -1;
}

.osc .osc-link {
	background: none;
	border: 0;
	color: var(--osc-ink);
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	min-height: 40px;
	padding: 0;
	text-decoration: underline;
	text-transform: none;
}

/* ---------- Consents ---------- */

.osc-consents {
	display: grid;
	gap: 14px;
}

.osc-consent {
	align-items: start;
	column-gap: 12px;
	display: grid;
	grid-template-columns: 24px 1fr;
}

.osc-consent input[type="checkbox"] {
	accent-color: var(--osc-ink);
	height: 22px;
	margin: 2px 0 0;
	width: 22px;
}

.osc-consent > label {
	font-size: 1em;
	font-weight: 400;
	margin: 0;
}

.osc-consent .osc-field__error {
	grid-column: 2;
}

.osc-consent a {
	text-decoration: underline;
}

/* Honeypot: off-screen for people and assistive tech. */
.osc-hp {
	height: 1px;
	left: -10000px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

/* ---------- Submit ---------- */

.osc-submit {
	display: grid;
	gap: 12px;
}

.osc .osc-submit__button {
	min-height: 54px;
	width: 100%;
}

@media (min-width: 640px) {
	.osc .osc-submit__button {
		justify-self: start;
		min-width: 320px;
		width: auto;
	}
}

.osc .osc-submit__button[disabled] {
	cursor: progress;
	opacity: 0.7;
}

.osc-submit__status {
	font-weight: 600;
	margin: 8px 0 0;
}

.osc-submit__legend {
	color: var(--osc-muted);
	font-size: 0.88em;
	margin: 0;
}

/* ---------- Success ---------- */

.osc-success {
	background: var(--osc-ink);
	border-radius: var(--osc-radius);
	color: #eeece6;
	padding: 28px 22px;
}

.osc-success:focus {
	outline: 3px solid var(--osc-accent);
	outline-offset: 3px;
}

.osc-success__title {
	color: #fff;
	margin: 0 0 12px;
}

.osc-success__text {
	display: grid;
	gap: 8px;
	margin: 0 0 14px;
}

.osc-success__ref {
	border: 1px dashed var(--osc-accent);
	color: var(--osc-accent);
	display: inline-block;
	font-size: 1.1em;
	font-weight: 700;
	letter-spacing: 0.04em;
	margin: 0 0 18px;
	padding: 8px 12px;
}

.osc-success__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.osc .osc-button {
	align-items: center;
	border: 2px solid var(--osc-accent);
	border-radius: var(--osc-radius);
	display: inline-flex;
	font-weight: 700;
	min-height: 48px;
	padding: 10px 18px;
	text-decoration: none;
}

.osc .osc-button--primary {
	background: var(--osc-accent);
	color: var(--osc-ink);
}

.osc .osc-button--ghost {
	color: #eeece6;
}

@media (prefers-reduced-motion: reduce) {
	.osc *,
	.osc *::before,
	.osc *::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
