/* TB Consent Gate — signature modal (Phase 2). Gold #d1b474, per the approved mockup.
   Selectors are prefixed (.tbs-*) and set their own font/box rules so theme
   (Elementor) button/input styles do not leak in. */
.tbs-overlay {
	position: fixed;
	inset: 0;
	/* Max value: golfscape raises <whitelabel-packages> to z-index 2147483000
	   while its mobile booking panel (#open) is shown; below that the modal
	   opens hidden behind the widget. Also above the golf iframe bar (999). */
	z-index: 2147483647;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(32, 27, 18, 0.55);
	opacity: 0;
	transition: opacity 0.18s ease;
	-webkit-tap-highlight-color: transparent;
}
.tbs-overlay[hidden] { display: none; }
.tbs-overlay.is-open { opacity: 1; }

.tbs-dialog,
.tbs-dialog * { box-sizing: border-box; }
.tbs-dialog {
	position: relative;
	width: min(100%, 440px);
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	overflow: auto;
	padding: 24px 24px 22px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
	color: #2b2b2b;
	font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	text-align: left;
	transform: translateY(8px) scale(0.98);
	transition: transform 0.2s ease;
}
.tbs-overlay.is-open .tbs-dialog { transform: none; }

.tbs-dialog .tbs-x {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #8a8a8a;
	font: 24px/34px Arial, sans-serif;
	cursor: pointer;
	box-shadow: none;
}
.tbs-dialog .tbs-x:hover { background: #f4efe4; color: #333; }

.tbs-dialog .tbs-title {
	margin: 0 32px 2px 0;
	padding: 0;
	color: #222;
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
}
.tbs-dialog .tbs-sub { margin: 0 0 16px; color: #8c8c8c; font-size: 13px; }

.tbs-form { margin: 0; }

.tbs-dialog .tbs-consent {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	margin: 0 0 16px;
	padding: 10px 12px;
	background: #faf6ef;
	border: 1px solid #d1b474;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.45;
	cursor: pointer;
}
.tbs-dialog .tbs-consent input {
	flex: none;
	width: 16px;
	height: 16px;
	margin: 2px 0 0;
	accent-color: #d1b474;
	cursor: pointer;
}

/* PDP block: the consents ticked on the page, read-only */
.tbs-dialog .tbs-consents {
	margin: 0 0 16px;
	padding: 10px 12px 10px 32px;
	background: #faf6ef;
	border: 1px solid #d1b474;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.45;
	list-style: none;
}
.tbs-dialog .tbs-consents li { position: relative; margin: 0 0 6px; padding: 0; }
.tbs-dialog .tbs-consents li:last-child { margin-bottom: 0; }
.tbs-dialog .tbs-consents li::before {
	content: "";
	position: absolute;
	left: -18px;
	top: 3px;
	width: 5px;
	height: 10px;
	border: solid #3c8d4f;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.tbs-dialog .tbs-consents[hidden], .tbs-dialog .tbs-consent[hidden] { display: none; }

.tbs-dialog .tbs-label {
	display: block;
	margin: 0 0 6px;
	color: #333;
	font-size: 13px;
	font-weight: 600;
}

.tbs-dialog .tbs-email {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid #ddd6c8;
	border-radius: 6px;
	box-shadow: none;
	color: #222;
	font-family: inherit;
	font-size: 16px; /* >= 16px: no iOS zoom on focus */
	line-height: 1.3;
}
.tbs-dialog .tbs-email:focus { outline: none; border-color: #d1b474; box-shadow: 0 0 0 3px rgba(209, 180, 116, 0.25); }
.tbs-dialog .tbs-email[aria-invalid="true"] { border-color: #c0392b; }
.tbs-field-err { min-height: 18px; margin: 3px 0 6px; color: #c0392b; font-size: 12px; }

.tbs-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.tbs-pad {
	position: relative;
	border: 1.5px dashed #d1b474;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}
/* signature baseline + hint, as in the mockup: DOM overlays on top of the
   (opaque) canvas, so they never end up in the exported PNG */
.tbs-pad::after {
	content: "";
	position: absolute;
	z-index: 2;
	left: 16px;
	right: 16px;
	bottom: 30px;
	border-top: 1px solid #ece2cc;
	pointer-events: none;
}
.tbs-canvas {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	height: 150px;
	min-height: 120px;
	background: transparent;
	touch-action: none;
	cursor: crosshair;
	-webkit-user-select: none;
	user-select: none;
}
.tbs-hint {
	position: absolute;
	right: 12px;
	bottom: 8px;
	z-index: 2;
	color: #bfae86;
	font-size: 11px;
	pointer-events: none;
}

.tbs-debug { margin-top: 6px; color: #666; font: 11px/1.4 ui-monospace, Menlo, Consolas, monospace; }
.tbs-err { min-height: 20px; margin: 8px 0 4px; color: #c0392b; font-size: 13px; }

.tbs-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.tbs-dialog .tbs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 10px 14px;
	border-radius: 6px;
	box-shadow: none;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}
.tbs-dialog .tbs-clear { background: #fff; border: 1px solid #ddd6c8; color: #666; font-weight: 500; }
.tbs-dialog .tbs-clear:hover { background: #faf6ef; color: #333; }
.tbs-dialog .tbs-submit { background: #d1b474; border: 1px solid #d1b474; color: #fff; }
.tbs-dialog .tbs-submit:hover { background: #c4a35c; border-color: #c4a35c; }
.tbs-dialog .tbs-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.tbs-dialog .tbs-btn:focus-visible { outline: 2px solid #8a6d2f; outline-offset: 2px; }

.tbs-spin {
	display: none;
	width: 15px;
	height: 15px;
	border: 2px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: tbs-spin 0.8s linear infinite;
}
.tbs-form.is-busy .tbs-spin { display: inline-block; }
.tbs-form.is-busy .tbs-submit:disabled { opacity: 0.85; cursor: progress; }
@keyframes tbs-spin { to { transform: rotate(360deg); } }

body.tb-consent-locked { overflow: hidden; }

/* Phones: bottom sheet so the pad gets the full width. */
@media (max-width: 480px) {
	.tbs-overlay { align-items: flex-end; padding: 0; }
	.tbs-dialog {
		width: 100%;
		max-height: 100vh;
		max-height: 100dvh;
		padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
		border-radius: 14px 14px 0 0;
	}
	.tbs-canvas { height: 170px; }
}

@media (prefers-reduced-motion: reduce) {
	.tbs-overlay, .tbs-dialog { transition: none; }
	.tbs-spin { animation-duration: 2s; }
}
