/**
 * Tinaroo Barra Bash Stand Manager – Frontend Form Styles
 *
 * Provides clean, accessible styling for the [tinaroo_stand_booking] shortcode.
 * All class names are namespaced with `.tbbs-` to avoid conflicts with theme styles.
 *
 * @package TinarooBarraBashStands
 */

/* ==========================================================================
   Wrapper
   ========================================================================== */

.tbbs-booking-wrap {
	max-width: 700px;
	margin: 0 auto;
	font-family: inherit;
	color: #333;
}

/* ==========================================================================
   Form Container
   ========================================================================== */

.tbbs-form {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 2rem;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.06 );
}

/* ==========================================================================
   Form Groups
   ========================================================================== */

.tbbs-form__group {
	margin-bottom: 1.5rem;
}

.tbbs-form__label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.4rem;
	color: #2c3e50;
	font-size: 0.95rem;
}

.tbbs-required {
	color: #c0392b;
	margin-left: 2px;
}

.tbbs-optional {
	font-weight: 400;
	font-size: 0.82em;
	color: #777;
	margin-left: 4px;
}

/* ==========================================================================
   Text Inputs & Textarea
   ========================================================================== */

.tbbs-form__input,
.tbbs-form__textarea {
	display: block;
	width: 100%;
	padding: 0.625rem 0.875rem;
	font-size: 1rem;
	font-family: inherit;
	line-height: 1.5;
	color: #333;
	background: #fafafa;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tbbs-form__input:focus,
.tbbs-form__textarea:focus {
	outline: none;
	background: #fff;
	border-color: #2980b9;
	box-shadow: 0 0 0 3px rgba( 41, 128, 185, 0.18 );
}

.tbbs-form__textarea {
	resize: vertical;
	min-height: 110px;
}

/* ==========================================================================
   Stand Selection Grid
   ========================================================================== */

.tbbs-stands-fieldset {
	border: none;
	padding: 0;
	margin: 0;
}

.tbbs-stands-hint {
	font-size: 0.875rem;
	color: #666;
	margin: 0.25rem 0 0.75rem;
}

.tbbs-stands-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 130px, 1fr ) );
	gap: 0.75rem;
}

.tbbs-stand-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.3rem;
	padding: 0.875rem 0.5rem;
	border: 2px solid #27ae60;
	border-radius: 6px;
	cursor: pointer;
	text-align: center;
	background: #f0faf4;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.tbbs-stand-option:hover:not( .tbbs-stand-option--booked ) {
	background: #d5f0e0;
	border-color: #1e8449;
	transform: translateY( -1px );
}

/* Visually indicate the selected stand */
.tbbs-stand-radio:checked + .tbbs-stand-option__number {
	color: #1a5276;
}

.tbbs-stands-grid input[type="radio"]:checked ~ .tbbs-stand-option__number {
	font-weight: 700;
}

.tbbs-stand-option--booked {
	border-color: #ccc;
	background: #f5f5f5;
	cursor: not-allowed;
	opacity: 0.65;
}

/* Screen-reader only – hide radio visually but keep it accessible */
.tbbs-stand-radio {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

/* Highlight selected option via the :has() relational pseudo-class (progressive enhancement) */
.tbbs-stand-option:has( .tbbs-stand-radio:checked ) {
	background: #d0eaf8;
	border-color: #2980b9;
}

.tbbs-stand-option__number {
	font-weight: 600;
	font-size: 0.95rem;
	color: #1e8449;
}

.tbbs-stand-option--booked .tbbs-stand-option__number {
	color: #999;
}

.tbbs-stand-option__status {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.tbbs-stand-option__status--available {
	color: #27ae60;
}

.tbbs-stand-option__status--booked {
	color: #c0392b;
}

/* ==========================================================================
   Checkbox / Terms
   ========================================================================== */

.tbbs-form__group--checkbox {
	background: #fef9e7;
	border: 1px solid #f39c12;
	border-radius: 4px;
	padding: 1rem 1.125rem;
}

.tbbs-form__checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	cursor: pointer;
	font-size: 0.95rem;
	line-height: 1.6;
	color: #333;
}

.tbbs-form__checkbox-label input[type="checkbox"] {
	flex-shrink: 0;
	margin-top: 3px;
	width: 17px;
	height: 17px;
	cursor: pointer;
	accent-color: #2980b9;
}

/* ==========================================================================
   Required Note
   ========================================================================== */

.tbbs-required-note {
	font-size: 0.82em;
	color: #777;
	margin: 0 0 1rem;
}

/* ==========================================================================
   Messages (success / error)
   ========================================================================== */

.tbbs-messages {
	display: none;
	padding: 1rem 1.125rem;
	border-radius: 4px;
	margin-bottom: 1.25rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.tbbs-messages--success {
	background: #eafaf1;
	border: 1px solid #27ae60;
	color: #1e6e3e;
}

.tbbs-messages--error {
	background: #fdedec;
	border: 1px solid #c0392b;
	color: #922b21;
}

/* ==========================================================================
   Submit Button & Spinner
   ========================================================================== */

.tbbs-form__submit {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 0.5rem;
}

.tbbs-btn--primary {
	display: inline-block;
	padding: 0.75rem 2rem;
	background: #2980b9;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.2s ease;
}

.tbbs-btn--primary:hover {
	background: #1f6390;
}

.tbbs-btn--primary:focus-visible {
	outline: 3px solid #2980b9;
	outline-offset: 2px;
}

.tbbs-btn--primary:disabled {
	background: #95a5a6;
	cursor: not-allowed;
}

.tbbs-spinner {
	display: none;
	width: 22px;
	height: 22px;
	border: 3px solid #ddd;
	border-top-color: #2980b9;
	border-radius: 50%;
	animation: tbbs-spin 0.7s linear infinite;
}

@keyframes tbbs-spin {
	to {
		transform: rotate( 360deg );
	}
}

/* ==========================================================================
   All-Booked Notice
   ========================================================================== */

.tbbs-notice {
	padding: 1rem 1.25rem;
	border-radius: 4px;
}

.tbbs-notice--info {
	background: #ebf5fb;
	border: 1px solid #2980b9;
	color: #1a5276;
}

.tbbs-notice p {
	margin: 0;
}

/* ==========================================================================
   Responsive – smaller screens
   ========================================================================== */

@media ( max-width: 520px ) {
	.tbbs-form {
		padding: 1.25rem;
	}

	.tbbs-stands-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}
