/* AssociaManager - Booking Form Modern Styles */
.am-booking-container {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.am-booking-card {
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	border: 1px solid #e5e7eb;
}

.am-booking-header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 40px 30px;
	text-align: center;
	position: relative;
	overflow: hidden;
}

.am-booking-header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
	opacity: 0.3;
}

.am-lesson-icon {
	margin-bottom: 20px;
	position: relative;
	z-index: 1;
}

.am-lesson-icon svg {
	color: rgba(255, 255, 255, 0.9);
}

.am-lesson-info {
	position: relative;
	z-index: 1;
}

.am-booking-header h1 {
	font-size: 2.5rem;
	font-weight: 700;
	margin: 0 0 15px 0;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.am-course-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(255, 255, 255, 0.2);
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 0.9rem;
	font-weight: 500;
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.3);
}

.am-course-badge svg {
	width: 16px;
	height: 16px;
}

.am-lesson-description {
	margin-top: 15px;
	font-size: 1.1rem;
	opacity: 0.9;
	line-height: 1.6;
}

.am-booking-form {
	padding: 40px 30px;
}

.am-section-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 25px;
	padding-bottom: 15px;
	border-bottom: 2px solid #f3f4f6;
}

.am-section-header svg {
	color: #667eea;
	flex-shrink: 0;
}

.am-section-header h3 {
	font-size: 1.4rem;
	font-weight: 600;
	color: #1f2937;
	margin: 0;
}

.am-slots-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 40px;
}

.am-slot-card {
	position: relative;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	transition: all 0.3s ease;
	cursor: pointer;
	overflow: hidden;
}

.am-slot-card:hover {
	border-color: #667eea;
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.am-slot-card.disabled {
	opacity: 0.5;
	cursor: not-allowed;
	background: #f9fafb;
}

.am-slot-card input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.am-slot-card input[type="checkbox"]:checked + label {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border-color: #667eea;
}

.am-slot-card input[type="checkbox"]:checked + label .am-slot-date svg,
.am-slot-card input[type="checkbox"]:checked + label .am-slot-time svg {
	color: white;
}

.am-slot-card input[type="checkbox"]:checked + label::before {
	content: '✓';
	position: absolute;
	top: 15px;
	left: 15px;
	background: rgba(255, 255, 255, 0.2);
	color: white;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 12px;
}

.am-slot-card label {
	display: block;
	padding: 10px 20px;
	cursor: pointer;
	transition: all 0.3s ease;
	background: white;
	border-radius: 10px;
	position: relative;
}

.am-slot-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 15px;
}

.am-slot-date {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: 1.1rem;
	margin-left: 30px; /* Spazio per la checkbox */
	flex: 1;
	min-width: 0; /* consente al testo di ridursi invece di sforare */
}

.am-slot-date svg {
	color: #667eea;
	flex-shrink: 0;
}

.am-slot-time {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #6b7280;
	font-size: 0.95rem;
	flex: 1;
	min-width: 0; /* consente al testo di ridursi invece di sforare */
}

.am-slot-time svg {
	color: #9ca3af;
	flex-shrink: 0;
}

.am-slot-availability {
	text-align: right;
	flex-shrink: 0;
}

.am-available {
	background: #d1fae5;
	color: #065f46;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 0.85rem;
	font-weight: 500;
}

.am-sold-out {
	background: #fee2e2;
	color: #991b1b;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 0.85rem;
	font-weight: 500;
}

.am-form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
	gap: 25px;
	margin-bottom: 30px;
}

.am-form-group {
	display: flex;
	flex-direction: column;
}

.am-form-group label {
	font-weight: 600;
	color: #374151;
	margin-bottom: 8px;
	font-size: 0.95rem;
}

.am-form-group input,
.am-form-group select {
	box-sizing: border-box; /* padding+bordo dentro la larghezza: niente sforo */
	width: 100%;
	max-width: 100%;
	min-width: 0;
	padding: 12px 16px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	font-size: 1rem;
	transition: all 0.3s ease;
	background: white;
}

.am-form-group input:focus,
.am-form-group select:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.am-form-group input::placeholder {
	color: #9ca3af;
}

.am-privacy-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.am-privacy-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
	font-size: 0.95rem;
	line-height: 1.5;
}

.am-privacy-checkbox input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.am-checkmark {
	width: 20px;
	height: 20px;
	border: 2px solid #d1d5db;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	flex-shrink: 0;
	margin-top: 2px;
}

.am-privacy-checkbox input[type="checkbox"]:checked + .am-checkmark {
	background: #667eea;
	border-color: #667eea;
}

.am-privacy-checkbox input[type="checkbox"]:checked + .am-checkmark::after {
	content: '✓';
	color: white;
	font-weight: bold;
	font-size: 14px;
}

.am-privacy-text {
    color: #374151;
}

.am-privacy-link {
    color: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    text-decoration: underline;
}
.am-privacy-link:hover {
    text-decoration: underline;
}

.am-form-actions {
	display: flex;
	gap: 15px;
	justify-content: center;
	margin-top: 40px;
	flex-wrap: wrap;
}

.am-submit-btn {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border: none;
	padding: 16px 32px;
	border-radius: 12px;
	font-size: 1.1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 10px;
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.am-submit-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.am-submit-btn:active {
	transform: translateY(0);
}

.am-cancel-btn {
	background: white;
	color: #6b7280;
	border: 2px solid #e5e7eb;
	padding: 14px 24px;
	border-radius: 12px;
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 8px;
}

.am-cancel-btn:hover {
	background: #f9fafb;
	border-color: #d1d5db;
	color: #374151;
	text-decoration: none;
}

/* Success Page Styles */
.am-booking-success-page {
	text-align: center;
	padding: 60px 30px;
	background: white;
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.am-success-icon {
	margin-bottom: 30px;
}

.am-booking-success-page h2 {
	font-size: 2.2rem;
	font-weight: 700;
	color: #1f2937;
	margin-bottom: 20px;
}

.am-booking-success-page p {
	font-size: 1.2rem;
	color: #6b7280;
	margin-bottom: 40px;
	line-height: 1.6;
}

.am-back-btn {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 16px 32px;
	border-radius: 12px;
	text-decoration: none;
	font-weight: 600;
	display: inline-block;
	transition: all 0.3s ease;
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.am-back-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
	text-decoration: none;
	color: white;
}

/* Error Styles */
/* NB le quattro proprietà di spaziatura qui sotto erano rimaste ORFANE fuori da
   questo blocco (dopo .am-form-group input.error:focus), con una graffa di troppo.
   Per il modo in cui il browser recupera da un errore di sintassi, quelle righe
   gli facevano scartare TUTTO il blocco @media (max-width: 768px) qui sotto:
   l'adattamento al telefono era scritto ma non veniva mai applicato. */
.am-booking-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
	padding: 16px 20px;
	border-radius: 8px;
	margin-bottom: 20px;
	text-align: center;
}

.am-form-group input.error,
.am-form-group select.error {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.am-form-group input.error:focus {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
	.am-booking-container {
		padding: 15px;
	}

	.am-booking-header {
		padding: 30px 20px;
	}

	.am-booking-header h1 {
		font-size: 2rem;
	}

	.am-booking-form {
		padding: 30px 20px;
	}


	.am-form-grid {
		grid-template-columns: 1fr;
	}

	.am-form-actions {
		flex-direction: column;
		align-items: center;
	}

	.am-submit-btn,
	.am-cancel-btn {
		width: 100%;
		justify-content: center;
	}
}

@media (max-width: 480px) {
	.am-booking-header h1 {
		font-size: 1.8rem;
	}

	.am-course-badge {
		font-size: 0.8rem;
		padding: 6px 12px;
	}

	/* Slot: impila data / orario / posti in colonna per evitare che sforino */
	.am-slot-content {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.am-slot-date,
	.am-slot-time,
	.am-slot-availability {
		flex: none;
		width: 100%;
	}

	.am-slot-time,
	.am-slot-availability {
		margin-left: 30px; /* allinea con la data (spazio checkbox) */
		text-align: left;
	}
}
