/*
 * BCS Redemption — scoped styles (prototype port).
 */

.bcs-voucher,
.bcs-voucher *,
.bcs-voucher-canvas .bcs-voucher-canvas__wrapper {
	box-sizing: border-box;
}

body.bcs-voucher-page:not(.customize-preview),
body.bcs-voucher-canvas {
	background: var(--bcs-bg, oklch(0.985 0.005 80));
	color: var(--bcs-ink, oklch(0.22 0.01 60));
	font-family: Inter, system-ui, -apple-system, sans-serif;
	font-feature-settings: "ss01", "cv11";
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

body.bcs-voucher-page .bcs-voucher-page__outer,
body.bcs-voucher-canvas .bcs-voucher-canvas__wrapper {
	min-height: 100vh;
	display: grid;
	align-items: center;
	justify-items: center;
	padding: 32px 20px;
	width: 100%;
}

body.bcs-voucher-page .bcs-voucher-page__outer {
	min-height: 60vh;
}

.bcs-voucher {
	--bcs-bg: oklch(0.985 0.005 80);
	--bcs-bg2: oklch(0.97 0.008 80);
	--bcs-ink: oklch(0.22 0.01 60);
	--bcs-ink2: oklch(0.45 0.01 60);
	--bcs-ink3: oklch(0.65 0.01 60);
	--bcs-line: oklch(0.9 0.008 80);
	--bcs-line2: oklch(0.82 0.01 80);
	--bcs-accent: oklch(0.65 0.15 177);
	--bcs-accent-ink: oklch(0.3 0.08 177);
	--bcs-accent-soft: oklch(0.94 0.04 192);
	--bcs-danger: oklch(0.55 0.18 25);
	--bcs-radius: 14px;
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
	position: relative;
}

.bcs-voucher__inline-link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
}

.bcs-voucher__inline-link:hover,
.bcs-voucher__inline-link:focus-visible {
	text-decoration-thickness: 2px;
}

.bcs-voucher__card {
	background: #fff;
	border: 1px solid var(--bcs-line);
	border-radius: var(--bcs-radius);
	padding: 36px 32px 32px;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 20px 40px -24px rgba(50, 40, 20, 0.15);
}

.bcs-voucher__brand {
	font-size: 11px;
	letter-spacing: 0.18em;
	font-weight: 600;
	color: var(--bcs-ink3);
	text-transform: uppercase;
	margin-bottom: 18px;
}

.bcs-voucher__title {
	font-size: 26px;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.2;
	margin: 0 0 8px;
	text-wrap: balance;
}

.bcs-voucher__title--voucher::after {
	content: " \1F389";
	font-style: normal;
}

.bcs-voucher__sub {
	font-size: 15px;
	color: var(--bcs-ink2);
	margin: 0 0 28px;
	text-wrap: pretty;
}

.bcs-voucher__field {
	margin-bottom: 14px;
}

.bcs-voucher__label {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: var(--bcs-ink2);
	margin-bottom: 6px;
	letter-spacing: 0.01em;
}

.bcs-voucher__input {
	display: block;
	width: 100%;
	padding: 12px 14px;
	font: inherit;
	font-size: 15px;
	color: var(--bcs-ink);
	background: var(--bcs-bg2);
	border: 1px solid var(--bcs-line2);
	border-radius: 10px;
	outline: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.bcs-voucher__input:focus {
	border-color: var(--bcs-ink);
	background: #fff;
}

.bcs-voucher__input.is-invalid {
	border-color: var(--bcs-danger);
}

.bcs-voucher__error {
	font-size: 12px;
	color: var(--bcs-danger);
	margin-top: 6px;
	min-height: 1.25em;
}

.bcs-voucher__error.is-empty:not(.force),
.bcs-voucher__error:empty:not(.force) {
	color: transparent;
}

.bcs-voucher__consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 12px 0 16px;
	font-size: 13px;
	color: var(--bcs-ink2);
	line-height: 1.45;
	cursor: pointer;
	user-select: none;
}

.bcs-voucher__checkbox-input {
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	margin-top: 1px;
	border-radius: 5px;
	border: 1.5px solid var(--bcs-line2);
	background: #fff;
	cursor: pointer;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.bcs-voucher__checkbox-input[aria-checked="true"] {
	background: var(--bcs-ink);
	border-color: var(--bcs-ink);
}

.bcs-voucher__checkbox-input:focus-visible {
	outline: 2px solid var(--bcs-accent);
	outline-offset: 2px;
}

.bcs-voucher__error--consent {
	margin-top: -8px;
	margin-bottom: 10px;
}

.bcs-voucher__submit {
	width: 100%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 16px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: #fff;
	background: var(--bcs-ink);
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease;
}

.bcs-voucher__submit:disabled {
	color: var(--bcs-ink3);
	background: var(--bcs-line);
	cursor: not-allowed;
	opacity: 0.85;
}

.bcs-voucher__submit:active:not(:disabled) {
	transform: scale(0.99);
}

.bcs-voucher__spinner {
	display: none;
}

.bcs-voucher.is-loading .bcs-voucher__spinner {
	display: inline-block;
	animation: bcs-spin 0.8s linear infinite;
}

.bcs-voucher.is-loading .bcs-voucher__submit {
	pointer-events: none;
	opacity: 0.85;
}

.bcs-voucher__footer-msg {
	margin-top: 18px;
	font-size: 11px;
	color: var(--bcs-ink3);
	text-align: center;
	letter-spacing: 0.02em;
}

.bcs-voucher__view.is-hidden {
	display: none !important;
}

/* Ticket */
@keyframes bcs-ticket-in {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes bcs-char-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.bcs-voucher-ticket {
	animation: bcs-ticket-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
	position: relative;
	margin: 0 0 22px;
}

.bcs-voucher-ticket__notch {
	position: absolute;
	top: 50%;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--bcs-bg, oklch(0.985 0.005 80));
	border: 1px solid var(--bcs-line);
	transform: translateY(-50%);
}

.bcs-voucher-ticket__notch--left {
	left: -11px;
}

.bcs-voucher-ticket__notch--right {
	right: -11px;
}

body.bcs-voucher-canvas .bcs-voucher-ticket__notch {
	background: var(--bcs-bg, oklch(0.985 0.005 80));
}

.bcs-voucher-ticket__header {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 16px;
	background: var(--bcs-accent-soft);
	border: 1px solid color-mix(in oklch, var(--bcs-accent) 30%, var(--bcs-line));
	border-radius: 12px;
	padding: 22px 20px;
	position: relative;
	z-index: 1;
}

.bcs-voucher-ticket__divider {
	height: 44px;
	border-left: 1.5px dashed color-mix(in oklch, var(--bcs-accent) 45%, transparent);
}

.bcs-voucher-ticket__meta-right {
	text-align: right;
}

.bcs-voucher-ticket__meta-strong {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--bcs-accent-ink);
	margin-bottom: 4px;
}

.bcs-voucher-ticket__meta-dim {
	font-size: 11px;
	color: var(--bcs-accent-ink);
	opacity: 0.75;
}

.bcs-voucher-ticket__code {
	background: #fff;
	border: 1px solid var(--bcs-line2);
	border-top: none;
	border-radius: 0 0 12px 12px;
	padding: 20px 16px;
	margin-top: -1px;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	font-family: "JetBrains Mono", ui-monospace, monospace;
	min-height: 84px;
}

.bcs-voucher-ticket__char {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 44px;
	font-size: 22px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--bcs-ink);
	background: var(--bcs-bg2);
	border: 1px solid var(--bcs-line);
	border-radius: 6px;
	animation: bcs-char-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@media (max-width: 420px) {
	.bcs-voucher-ticket__char {
		width: 28px;
		height: 38px;
		font-size: 18px;
	}
}

.bcs-voucher-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.bcs-voucher__btn-secondary,
.bcs-voucher__btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 13px 14px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	border-radius: 10px;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease;
	min-height: 46px;
}

.bcs-voucher__btn-secondary {
	color: var(--bcs-ink);
	background: #fff;
	border: 1px solid var(--bcs-line2);
}

.bcs-voucher__btn-secondary:hover {
	background: var(--bcs-bg2);
}

.bcs-voucher__btn-primary {
	color: #fff;
	background: var(--bcs-ink);
	border: none;
}

.bcs-voucher-sent {
	margin-top: 18px;
	padding: 12px 14px;
	background: var(--bcs-bg2);
	border: 1px solid var(--bcs-line);
	border-radius: 10px;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	color: var(--bcs-ink2);
}

.bcs-voucher-sent svg {
	flex-shrink: 0;
	opacity: 0.8;
}

.bcs-voucher-reset-wrap {
	text-align: center;
	margin-top: 20px;
}

.bcs-voucher-reset {
	background: none;
	border: none;
	color: var(--bcs-ink3);
	font-size: 12px;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
	font-family: inherit;
}

.bcs-voucher__confetti {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 9998;
	display: none;
	width: 100%;
	height: 100%;
}

.bcs-voucher__confetti:not([hidden]) {
	display: block;
}

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