/**
 * Backlot — Biglietteria (Brief C4.2.b)
 *
 * Multilayer: base PNG + screen video Remotion + Franco PNG + UI HTML actions.
 * Debug mode: outline LCD/Franco + Franco draggable.
 */

/* ============================================================
   1. BODY + STAGE
   ============================================================ */
.bkl-ticketeria-body {
	margin: 0; padding: 0;
	background: #0B0908;
	color: var(--backlot-text);
	overflow: hidden;
	font-family: var(--backlot-font-body);
	height: 100vh; height: 100dvh;
}
html:has(body.bkl-ticketeria-body) { overflow: hidden; height: 100vh; height: 100dvh; }

.bkl-ticketeria {
	position: fixed; inset: 0;
	width: 100vw; height: 100vh; height: 100dvh;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: radial-gradient(ellipse at 50% 30%, #1a1310 0%, #0B0908 70%), #0B0908;
}

.bkl-ticketeria__stage {
	position: relative;
	width: 100vw;
	max-width: calc(100vh * 16 / 9);
	max-width: calc(100dvh * 16 / 9);
	aspect-ratio: 16 / 9;
	overflow: hidden;
	animation: bkl-tk-stage-fadein 1000ms ease-out;
	box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
}
@media (max-aspect-ratio: 1/1) {
	.bkl-ticketeria__stage {
		max-width: 100vw;
		max-height: calc(100vw * 16 / 9);
		aspect-ratio: 9 / 16;
	}
}
@keyframes bkl-tk-stage-fadein { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   2. LAYERS
   ============================================================ */
.bkl-ticketeria__layer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
}
.bkl-ticketeria__layer img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center center;
	display: block;
}
.bkl-ticketeria__layer--base { z-index: 1; }

/* SR-only utility */
.bkl-sr-only {
	position: absolute !important;
	width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Honeypot: nascosto visivamente + tabindex=-1, bot lo riempiono, umani no */
.bkl-honeypot {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	width: 1px; height: 1px;
	opacity: 0;
	pointer-events: none;
}

/* ============================================================
   3. SCHERMO REMOTION VIDEO
   ============================================================ */
.bkl-ticketeria__screen {
	position: absolute;
	z-index: 2;
	overflow: hidden;
	pointer-events: none;
	background: #050403;
	/* Desktop coords calibrate dall'user (C4.2.b v1) */
	top: 31.73%;
	left: 31.82%;
	width: 36.48%;
	height: 37.37%;
	box-shadow:
		inset 0 0 18px rgba(0, 0, 0, 0.85),
		inset 0 1px 0 rgba(245, 198, 107, 0.12);
	border: 1px solid rgba(245, 198, 107, 0.18);
	border-radius: 2px;
}
.bkl-ticketeria__screen-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	display: block;
	pointer-events: none;
}
@media (max-aspect-ratio: 1/1) {
	.bkl-ticketeria__screen {
		/* Mobile coords calibrate dall'user (v1.16.2) */
		top: 29.77%;
		left: 26.15%;
		width: 47.45%;
		height: 42.48%;
	}
}

/* ============================================================
   4. FRANCO
   ============================================================ */
.bkl-ticketeria__franco {
	position: absolute;
	z-index: 3;
	object-fit: contain;
	object-position: bottom center;
	pointer-events: none;
	filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.55));
	/* Desktop coords calibrate dall'user */
	top: 20.35%;
	left: 73.68%;
	width: 22%;
	height: auto;
}
@media (max-aspect-ratio: 1/1) {
	.bkl-ticketeria__franco {
		/* Mobile coords calibrate dall'user (v1.16.2) */
		top: 44.91%;
		left: 56.20%;
		width: 38%;
		height: auto;
	}
}

/* ============================================================
   5. UI — Help menu (v1.16.2)
   DESKTOP: 3 card always-open orizzontali bottom center (no FAB)
   MOBILE:  FAB gold con SVG ticket, 3 opzioni espanse on-tap
   ============================================================ */
.bkl-fab-menu {
	position: fixed;
	bottom: 24px;
	left: 24px;
	z-index: 50;
}

.bkl-fab-menu__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(11, 9, 8, 0.5);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 250ms ease;
	z-index: -1;
}
.bkl-fab-menu[data-open="true"] .bkl-fab-menu__backdrop {
	opacity: 1;
	pointer-events: auto;
}

.bkl-fab-menu__toggle {
	width: 76px;
	height: 76px;
	border-radius: 50%;
	background: linear-gradient(135deg, #F5C66B 0%, #C9A84C 45%, #9B7A2E 100%);
	border: 2px solid rgba(245, 198, 107, 0.6);
	box-shadow:
		0 0 0 5px rgba(245, 198, 107, 0.18),
		0 6px 22px rgba(0, 0, 0, 0.45);
	color: #0B0908;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
	            box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1);
	position: relative;
	z-index: 2;
	animation: bkl-fab-breathe 3s ease-in-out infinite;
	padding: 0;
}

.bkl-fab-menu__toggle-icon {
	display: inline-flex;
	line-height: 1;
}
.bkl-fab-menu__toggle-icon svg {
	width: 30px;
	height: 30px;
	display: block;
}
.bkl-fab-menu__toggle-label {
	font-family: 'Geist', system-ui, -apple-system, sans-serif;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	opacity: 0.85;
}

@keyframes bkl-fab-breathe {
	0%, 100% {
		box-shadow:
			0 0 0 5px rgba(245, 198, 107, 0.18),
			0 6px 22px rgba(0, 0, 0, 0.45);
	}
	50% {
		box-shadow:
			0 0 0 10px rgba(245, 198, 107, 0.28),
			0 6px 32px rgba(0, 0, 0, 0.55);
	}
}

.bkl-fab-menu[data-open="true"] .bkl-fab-menu__toggle {
	transform: rotate(135deg);
	animation: none;
}
.bkl-fab-menu[data-open="true"] .bkl-fab-menu__toggle-label {
	opacity: 0;
}

.bkl-fab-menu__options {
	position: absolute;
	bottom: 92px;
	left: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	opacity: 0;
	pointer-events: none;
	transform: translateY(10px);
	transition: opacity 300ms cubic-bezier(0.16, 1, 0.3, 1),
	            transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
	min-width: 280px;
}
.bkl-fab-menu[data-open="true"] .bkl-fab-menu__options {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.bkl-fab-menu__option {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 18px;
	background: rgba(11, 9, 8, 0.88);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(245, 198, 107, 0.32);
	border-radius: 14px;
	color: #F2E8DA;
	cursor: pointer;
	transition: border-color 200ms ease, background 200ms ease, transform 200ms ease, opacity 250ms ease;
	text-align: left;
	font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.bkl-fab-menu__option:hover,
.bkl-fab-menu__option:focus-visible {
	border-color: rgba(245, 198, 107, 0.75);
	background: rgba(14, 11, 9, 0.96);
	outline: none;
}

.bkl-fab-menu__icon {
	font-size: 26px;
	flex-shrink: 0;
	line-height: 1;
}
.bkl-fab-menu__text {
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.bkl-fab-menu__title {
	font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
	font-style: normal;
	font-weight: 700;
	font-size: 16px;
	letter-spacing: -0.005em;
	color: #F5C66B;
	line-height: 1.2;
}
.bkl-fab-menu__sub {
	font-family: 'Geist', system-ui, -apple-system, sans-serif;
	font-weight: 500;
	font-size: 12px;
	letter-spacing: 0.01em;
	opacity: 0.78;
	line-height: 1.35;
	color: #E8E2D8;
}

/* ============================================================
   DESKTOP (landscape >1/1): FAB NASCOSTO, 3 CARD ALWAYS-OPEN
   bottom center, disposte orizzontalmente — no toggle, no backdrop
   ============================================================ */
@media (min-aspect-ratio: 1/1) {
	.bkl-fab-menu {
		/* Esci da fixed → absolute sullo stage bottom */
		position: absolute;
		bottom: 4%;
		left: 50%;
		transform: translateX(-50%);
		right: auto;
	}
	.bkl-fab-menu__toggle,
	.bkl-fab-menu__backdrop {
		display: none;
	}
	.bkl-fab-menu__options {
		position: static;
		flex-direction: row;
		gap: 16px;
		min-width: 0;
		opacity: 1;
		pointer-events: auto;
		transform: none;
		transition: none;
	}
	.bkl-fab-menu__option {
		opacity: 1;
		transform: none;
		flex: 0 0 auto;
		min-width: 240px;
		padding: 14px 20px;
	}
	.bkl-fab-menu__option:hover {
		transform: translateY(-2px);
		box-shadow: 0 0 24px rgba(245,198,107,0.28), 0 8px 24px rgba(0,0,0,0.5);
	}
}

/* ============================================================
   MOBILE (portrait 1/1 or narrower): FAB BIG + ticket icon,
   opzioni espanse on-tap con stagger
   ============================================================ */
@media (max-aspect-ratio: 1/1) {
	.bkl-fab-menu {
		bottom: 20px;
		left: 20px;
	}
	.bkl-fab-menu__options {
		min-width: calc(100vw - 80px);
		max-width: 360px;
		bottom: 98px;
	}
	/* Stagger solo mobile (desktop è always-open senza animation) */
	.bkl-fab-menu__option {
		opacity: 0;
		transform: translateX(-10px);
	}
	.bkl-fab-menu[data-open="true"] .bkl-fab-menu__option {
		opacity: 1;
		transform: translateX(0);
	}
	.bkl-fab-menu[data-open="true"] .bkl-fab-menu__option:nth-child(1) { transition-delay:  60ms; }
	.bkl-fab-menu[data-open="true"] .bkl-fab-menu__option:nth-child(2) { transition-delay: 120ms; }
	.bkl-fab-menu[data-open="true"] .bkl-fab-menu__option:nth-child(3) { transition-delay: 180ms; }
	.bkl-fab-menu__option:hover {
		transform: translateX(4px) !important;
	}
	.bkl-fab-menu__title {
		font-size: 17px;
	}
	.bkl-fab-menu__sub {
		font-size: 12px;
	}
}

/* ============================================================
   6. MODALS
   ============================================================ */
.bkl-modal {
	position: fixed; inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
}
.bkl-modal[hidden] { display: none !important; }

.bkl-modal__overlay {
	position: absolute; inset: 0;
	background: rgba(11, 9, 8, 0.88);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	animation: bkl-tk-fadein 260ms ease-out;
}
@keyframes bkl-tk-fadein { from { opacity: 0; } to { opacity: 1; } }

.bkl-modal__panel {
	position: relative;
	background: linear-gradient(180deg, #13100E 0%, #0B0908 100%);
	border: 1px solid rgba(245, 198, 107, 0.3);
	border-radius: 16px;
	padding: 36px 32px 28px;
	max-width: 540px; width: 92vw;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(245, 198, 107, 0.12);
	animation: bkl-tk-modal-in 380ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bkl-tk-modal-in {
	from { opacity: 0; transform: scale(0.94) translateY(10px); }
	to   { opacity: 1; transform: scale(1) translateY(0); }
}

.bkl-modal__close {
	position: absolute;
	top: 10px; right: 12px;
	width: 36px; height: 36px;
	background: transparent; border: none;
	color: var(--backlot-text-muted, #8C7E70);
	font-size: 26px; line-height: 1;
	cursor: pointer;
	transition: color 180ms;
}
.bkl-modal__close:hover,
.bkl-modal__close:focus-visible {
	color: var(--backlot-gold-soft, #F5C66B);
	outline: none;
}

.bkl-modal__title {
	font-family: var(--backlot-font-serif, 'Cormorant Garamond', Georgia, serif);
	font-style: italic;
	font-size: clamp(22px, 3vw, 32px);
	color: var(--backlot-gold-soft, #F5C66B);
	margin: 0 0 10px;
	text-align: center;
}
.bkl-modal__subtitle {
	font-size: 13px;
	color: var(--backlot-text-secondary, #C8BFB3);
	margin: 0 0 24px;
	text-align: center;
	line-height: 1.5;
}
.bkl-modal__footer-note {
	margin: 20px 0 0;
	font-size: 12px;
	color: var(--backlot-text-muted, #8C7E70);
	text-align: center;
}
.bkl-modal__footer-note a {
	color: var(--backlot-gold-soft, #F5C66B);
	text-decoration: none;
	border-bottom: 1px dashed rgba(245, 198, 107, 0.4);
}

/* ============================================================
   7. PURCHASE cards
   ============================================================ */
.bkl-purchase-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin-top: 8px;
}
@media (max-width: 520px) {
	.bkl-purchase-grid { grid-template-columns: 1fr; }
}

.bkl-product-card {
	background: rgba(20, 16, 12, 0.6);
	border: 1px solid rgba(245, 198, 107, 0.22);
	border-radius: 12px;
	padding: 18px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.bkl-product-card--premium {
	border-color: rgba(245, 198, 107, 0.55);
	background: linear-gradient(180deg, rgba(30, 22, 14, 0.8) 0%, rgba(18, 14, 10, 0.8) 100%);
	box-shadow: inset 0 0 20px rgba(245, 198, 107, 0.08);
}
.bkl-product-card__header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
}
.bkl-product-card__name {
	font-family: var(--backlot-font-serif, 'Cormorant Garamond', Georgia, serif);
	font-style: italic;
	font-size: 20px;
	color: var(--backlot-gold-soft, #F5C66B);
	margin: 0;
	line-height: 1.1;
}
.bkl-product-card__price {
	font-family: var(--backlot-font-mono, 'JetBrains Mono', monospace);
	font-size: 18px;
	color: var(--backlot-text, #E8E2D8);
	font-weight: 700;
}
.bkl-product-card__desc {
	font-size: 13px;
	color: var(--backlot-text-secondary, #C8BFB3);
	margin: 0;
	line-height: 1.45;
	flex: 1 1 auto;
}
.bkl-product-card__cta {
	display: block;
	text-align: center;
	padding: 12px 18px;
	background: linear-gradient(135deg, #F5C66B 0%, #C9A84C 50%, #9B7A2E 100%);
	color: #0B0908;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.03em;
	border-radius: 999px;
	text-decoration: none;
	transition: box-shadow 200ms, transform 200ms;
}
.bkl-product-card__cta:hover,
.bkl-product-card__cta:focus-visible {
	box-shadow: 0 0 22px rgba(245, 198, 107, 0.5), 0 6px 18px rgba(0, 0, 0, 0.4);
	transform: translateY(-1px);
	outline: none;
}

/* ============================================================
   8. FORMS (recovery + support)
   ============================================================ */
.bkl-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.bkl-form__input {
	width: 100%;
	padding: 14px 18px;
	background: rgba(0, 0, 0, 0.42);
	border: 1.5px solid rgba(245, 198, 107, 0.28);
	border-radius: 10px;
	font-family: var(--backlot-font-body, system-ui, sans-serif);
	font-size: 15px;
	color: var(--backlot-text, #E8E2D8);
	outline: none;
	box-sizing: border-box;
	transition: border-color 180ms, box-shadow 180ms;
}
.bkl-form__input:focus {
	border-color: var(--backlot-gold, #C9A84C);
	box-shadow: 0 0 0 3px rgba(245, 198, 107, 0.15);
}
.bkl-form__input::placeholder {
	color: rgba(200, 191, 179, 0.4);
}
.bkl-form__textarea {
	resize: vertical;
	min-height: 88px;
	font-family: var(--backlot-font-body, system-ui, sans-serif);
	line-height: 1.45;
}
.bkl-form__submit {
	width: 100%;
	margin-top: 6px;
	padding: 14px 22px;
	background: linear-gradient(135deg, #F5C66B 0%, #C9A84C 50%, #9B7A2E 100%);
	color: #0B0908;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.03em;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	transition: box-shadow 200ms, transform 200ms;
}
.bkl-form__submit:hover,
.bkl-form__submit:focus-visible {
	box-shadow: 0 0 26px rgba(245, 198, 107, 0.5), 0 6px 18px rgba(0, 0, 0, 0.4);
	transform: translateY(-1px);
	outline: none;
}
.bkl-form__submit:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
}
.bkl-form__feedback {
	margin: 4px 0 0;
	padding: 10px 14px;
	font-size: 13px;
	color: var(--backlot-gold-soft, #F5C66B);
	text-align: center;
	line-height: 1.45;
	background: rgba(245, 198, 107, 0.08);
	border-radius: 8px;
	border: 1px solid rgba(245, 198, 107, 0.18);
}
.bkl-form__feedback[hidden] { display: none; }
.bkl-form__feedback--error {
	color: #e5a5a5;
	background: rgba(229, 165, 165, 0.08);
	border-color: rgba(229, 165, 165, 0.25);
}

/* ============================================================
   9. DEBUG MODE (?debug=1)
   Entrambi screen + Franco sono drag+resize, handle visibile
   in basso-destra (quadratino colorato).
   ============================================================ */
.bkl-ticketeria[data-debug="true"] .bkl-ticketeria__screen {
	outline: 2px solid #ff3b3b;
	outline-offset: -2px;
	cursor: move;
	pointer-events: auto !important;
}
.bkl-ticketeria[data-debug="true"] .bkl-ticketeria__franco {
	outline: 2px solid #5dd9a3;
	outline-offset: -2px;
	cursor: move;
	pointer-events: auto !important;
}
.bkl-ticketeria[data-debug="true"] .bkl-ticketeria__screen::after,
.bkl-ticketeria[data-debug="true"] .bkl-ticketeria__franco::after {
	content: '';
	position: absolute;
	right: -8px; bottom: -8px;
	width: 16px; height: 16px;
	border: 2px solid #fff;
	cursor: nwse-resize;
	z-index: 999;
}
.bkl-ticketeria[data-debug="true"] .bkl-ticketeria__screen::after  { background: #ff3b3b; }
.bkl-ticketeria[data-debug="true"] .bkl-ticketeria__franco::after  { background: #5dd9a3; }
.bkl-ticketeria__debug-hud {
	position: fixed;
	bottom: 12px; right: 12px;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.92);
	color: #fff;
	font-family: 'Courier New', monospace;
	font-size: 11px;
	padding: 12px 16px;
	border: 1px solid #5dd9a3;
	border-radius: 6px;
	max-width: 360px;
	white-space: pre;
	user-select: text;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
	pointer-events: none;
}
.bkl-ticketeria__debug-hud strong { color: #ff3b3b; }
.bkl-ticketeria__debug-hud .green { color: #5dd9a3; }

/* ============================================================
   10. Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
	.bkl-ticketeria__stage,
	.bkl-modal__overlay,
	.bkl-modal__panel {
		animation: none !important;
	}
	.bkl-action-card,
	.bkl-product-card__cta,
	.bkl-form__submit {
		transition: none !important;
	}
}
