/**
 * Teslux VIP Booking - Responsive, Accessible Styling
 *
 * @package Teslux\Booking
 */

:root {
	--tlb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	--tlb-black: #111111;
	--tlb-dark: #1e1e1e;
	--tlb-gray-dark: #333333;
	--tlb-gray: #666666;
	--tlb-gray-light: #999999;
	--tlb-border: #e2e8f0;
	--tlb-border-hover: #cbd5e1;
	--tlb-bg-light: #f8fafc;
	--tlb-white: #ffffff;
	--tlb-gold: #c5a059;
	--tlb-gold-dark: #a8853b;
	--tlb-gold-light: #fdf8ed;
	--tlb-error: #dc2626;
	--tlb-error-bg: #fef2f2;
	--tlb-error-border: #fca5a5;
	--tlb-success: #15803d;
	--tlb-success-bg: #f0fdf4;
	--tlb-radius: 8px;
	--tlb-radius-sm: 4px;
	--tlb-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	--tlb-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
	--tlb-transition: 150ms ease;
}

.tlb-hidden {
	display: none !important;
}

/* App Container */
.tlb-container {
	font-family: var(--tlb-font);
	color: var(--tlb-dark);
	max-width: 1040px;
	margin: 0 auto;
	padding: 24px 16px;
	box-sizing: border-box;
}

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

.tlb-main-heading {
	font-size: 26px;
	font-weight: 700;
	color: var(--tlb-black);
	text-align: center;
	margin: 0 0 24px;
	letter-spacing: -0.02em;
}

/* Tile Grid */
.tlb-tile-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin-bottom: 30px;
}

@media (min-width: 480px) {
	.tlb-tile-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 768px) {
	.tlb-cols-3 .tlb-tile-grid,
	.tlb-cols-4 .tlb-tile-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	.tlb-cols-4 .tlb-tile-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* Single Tile */
.tlb-tile {
	background: var(--tlb-white);
	border: 1px solid var(--tlb-border);
	border-radius: var(--tlb-radius);
	padding: 22px 18px;
	text-align: left;
	cursor: pointer;
	box-shadow: var(--tlb-shadow-sm);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	transition: transform var(--tlb-transition), border-color var(--tlb-transition), box-shadow var(--tlb-transition);
	outline: none;
	position: relative;
	width: 100%;
}

.tlb-tile:hover {
	transform: translateY(-2px);
	border-color: var(--tlb-gold);
	box-shadow: var(--tlb-shadow);
}

.tlb-tile:active {
	transform: scale(0.98);
}

.tlb-tile:focus-visible {
	outline: 2px solid var(--tlb-gold);
	outline-offset: 2px;
}

.tlb-tile-active {
	border-color: var(--tlb-black);
	border-width: 2px;
	background-color: var(--tlb-gold-light);
	box-shadow: var(--tlb-shadow);
}

.tlb-tile-icon {
	color: var(--tlb-gold-dark);
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tlb-tile-title {
	font-size: 17px;
	font-weight: 700;
	color: var(--tlb-black);
	margin-bottom: 6px;
	line-height: 1.3;
}

.tlb-tile-desc {
	font-size: 13px;
	color: var(--tlb-gray);
	line-height: 1.45;
}

/* Panel Section */
.tlb-panel {
	background: var(--tlb-white);
	border: 1px solid var(--tlb-border);
	border-radius: var(--tlb-radius);
	box-shadow: var(--tlb-shadow);
	padding: 28px 24px;
	margin-bottom: 24px;
	animation: tlbPanelFade 200ms ease;
}

@keyframes tlbPanelFade {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.tlb-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--tlb-border);
	padding-bottom: 16px;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 12px;
}

.tlb-panel-title {
	font-size: 21px;
	font-weight: 700;
	color: var(--tlb-black);
	margin: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	outline: none;
}

.tlb-panel-icon {
	color: var(--tlb-gold-dark);
	display: flex;
	align-items: center;
}

.tlb-panel-close {
	background: transparent;
	border: 1px solid var(--tlb-border);
	border-radius: var(--tlb-radius-sm);
	padding: 7px 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--tlb-gray-dark);
	cursor: pointer;
	transition: background var(--tlb-transition), border-color var(--tlb-transition);
}

.tlb-panel-close:hover {
	background: var(--tlb-bg-light);
	border-color: var(--tlb-gray-light);
}

.tlb-panel-close:focus-visible {
	outline: 2px solid var(--tlb-gold);
	outline-offset: 2px;
}

/* Form Layout */
.tlb-form {
	position: relative;
}

.tlb-legend-notice {
	font-size: 13px;
	color: var(--tlb-gray);
	margin: 0 0 16px;
}

.tlb-fields-container {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px;
}

@media (min-width: 640px) {
	.tlb-fields-container {
		grid-template-columns: repeat(2, 1fr);
	}
	.tlb-field-customer_name,
	.tlb-field-origin_address,
	.tlb-field-destination_address,
	.tlb-field-comments,
	.tlb-field-airline_flight,
	.tlb-roundtrip-wrapper,
	.tlb-fieldset-wrapper {
		grid-column: span 2;
	}
}

/* Fields & Labels */
.tlb-field {
	display: flex;
	flex-direction: column;
}

.tlb-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--tlb-dark);
	margin-bottom: 6px;
}

.tlb-required {
	color: var(--tlb-error);
	font-weight: 700;
}

.tlb-help {
	font-size: 12px;
	color: var(--tlb-gray);
	margin-bottom: 6px;
	line-height: 1.4;
}

.tlb-input,
.tlb-select,
.tlb-textarea {
	width: 100%;
	min-height: 44px;
	padding: 10px 14px;
	font-size: 16px; /* Prevents iOS auto-zoom on focus */
	font-family: inherit;
	color: var(--tlb-black);
	background: var(--tlb-white);
	border: 1px solid var(--tlb-border);
	border-radius: var(--tlb-radius-sm);
	transition: border-color var(--tlb-transition), box-shadow var(--tlb-transition);
	outline: none;
}

.tlb-textarea {
	min-height: 90px;
	resize: vertical;
}

.tlb-input:focus,
.tlb-select:focus,
.tlb-textarea:focus {
	border-color: var(--tlb-gold-dark);
	box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.25);
}

.tlb-has-error .tlb-input,
.tlb-has-error .tlb-select,
.tlb-has-error .tlb-textarea {
	border-color: var(--tlb-error);
	background-color: var(--tlb-error-bg);
}

.tlb-error {
	font-size: 13px;
	color: var(--tlb-error);
	margin-top: 5px;
	display: flex;
	align-items: center;
	gap: 4px;
	animation: tlbErrorSlide 150ms ease;
}

@keyframes tlbErrorSlide {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Fieldsets & Return Trip */
.tlb-fieldset {
	border: 1px solid var(--tlb-border);
	border-radius: var(--tlb-radius);
	padding: 18px 16px;
	margin: 10px 0;
	background: var(--tlb-bg-light);
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

@media (min-width: 640px) {
	.tlb-fieldset {
		grid-template-columns: repeat(2, 1fr);
	}
	.tlb-field-return_origin_address,
	.tlb-field-return_destination_address,
	.tlb-field-return_airline_flight {
		grid-column: span 2;
	}
}

.tlb-legend {
	font-size: 15px;
	font-weight: 700;
	color: var(--tlb-black);
	padding: 0 8px;
}

/* Checkbox & Radio styling */
.tlb-checkbox-label,
.tlb-radio-label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	cursor: pointer;
	user-select: none;
	min-height: 44px;
}

.tlb-checkbox-label input,
.tlb-radio-label input {
	width: 18px;
	height: 18px;
	accent-color: var(--tlb-gold-dark);
	cursor: pointer;
}

.tlb-radio-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	grid-column: span 2;
}

/* Error Summary Alert */
.tlb-error-summary {
	background: var(--tlb-error-bg);
	border: 1px solid var(--tlb-error-border);
	border-left: 5px solid var(--tlb-error);
	border-radius: var(--tlb-radius-sm);
	padding: 16px 20px;
	margin-bottom: 24px;
	outline: none;
}

.tlb-error-summary:focus-visible {
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

.tlb-error-summary-title {
	margin: 0 0 8px;
	color: var(--tlb-error);
	font-size: 15px;
	font-weight: 700;
}

.tlb-error-summary-list {
	margin: 0;
	padding-left: 20px;
	color: #991b1b;
	font-size: 14px;
}

.tlb-error-summary-list li {
	margin-bottom: 4px;
}

.tlb-error-summary-list a {
	color: #991b1b;
	text-decoration: underline;
}

.tlb-error-summary-list a:hover {
	color: var(--tlb-error);
}

/* Submit Actions */
.tlb-form-actions {
	margin-top: 24px;
}

.tlb-submit-btn {
	background: var(--tlb-black);
	color: var(--tlb-white);
	border: none;
	border-radius: var(--tlb-radius-sm);
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	transition: background var(--tlb-transition), transform var(--tlb-transition);
}

.tlb-submit-btn:hover {
	background: #2a2a2a;
	color: var(--tlb-gold);
}

.tlb-submit-btn:focus-visible {
	outline: 2px solid var(--tlb-gold);
	outline-offset: 3px;
}

.tlb-submit-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* Spinner */
.tlb-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: var(--tlb-white);
	border-radius: 50%;
	animation: tlbSpin 700ms linear infinite;
}

.tlb-is-submitting .tlb-spinner {
	display: inline-block;
}

@keyframes tlbSpin {
	to {
		transform: rotate(360deg);
	}
}

.tlb-recaptcha-notice {
	font-size: 11px;
	color: var(--tlb-gray-light);
	margin-top: 14px;
	line-height: 1.5;
}

.tlb-recaptcha-notice a {
	color: var(--tlb-gray);
	text-decoration: underline;
}

/* Confirmation Card */
.tlb-confirmation-box {
	background: var(--tlb-success-bg);
	border: 1px solid #bbf7d0;
	border-radius: var(--tlb-radius);
	padding: 36px 24px;
	text-align: center;
	outline: none;
	animation: tlbPanelFade 250ms ease;
}

.tlb-confirmation-icon {
	margin-bottom: 16px;
	display: flex;
	justify-content: center;
}

.tlb-confirmation-title {
	font-size: 22px;
	font-weight: 700;
	color: #14532d;
	margin: 0 0 10px;
}

.tlb-confirmation-ref {
	font-size: 16px;
	color: #166534;
	margin: 0 0 12px;
}

.tlb-confirmation-text {
	font-size: 15px;
	color: #14532d;
	max-width: 540px;
	margin: 0 auto 16px;
	line-height: 1.6;
}

.tlb-confirmation-phone {
	font-size: 14px;
	color: #166534;
	margin: 0;
}

.tlb-confirmation-phone a {
	color: #14532d;
	text-decoration: underline;
}

/* Reduced Motion Override (WCAG compliance) */
@media (prefers-reduced-motion: reduce) {
	.tlb-tile,
	.tlb-panel,
	.tlb-error,
	.tlb-confirmation-box,
	.tlb-submit-btn,
	.tlb-spinner {
		transition: none !important;
		animation: none !important;
		transform: none !important;
	}
}
