/* CMA Prenotazioni — frontend */
.cma-book {
	--cma-book-ink: #22313f;
	--cma-book-muted: #5a6b7a;
	--cma-book-line: #d5dee6;
	--cma-book-bg: #f4f8fb;
	--cma-book-accent: #1f6b8a;
	--cma-book-accent-2: #2a8fb0;
	margin: 2.5rem 0;
	padding: 2rem 1.25rem 2.5rem;
	background:
		radial-gradient(ellipse 80% 60% at 10% 0%, rgba(42, 143, 176, 0.12), transparent 55%),
		linear-gradient(180deg, #f7fafc 0%, var(--cma-book-bg) 100%);
	border-top: 1px solid var(--cma-book-line);
	border-bottom: 1px solid var(--cma-book-line);
	color: var(--cma-book-ink);
}

.cma-book__head {
	max-width: 720px;
	margin: 0 auto 1.5rem;
	text-align: center;
}

.cma-book__eyebrow {
	margin: 0 0 0.35rem;
	font-size: 0.75rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cma-book-accent);
	font-weight: 700;
}

.cma-book__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.6rem, 3vw, 2.1rem);
	font-weight: 700;
	letter-spacing: -0.02em;
}

.cma-book__lead {
	margin: 0;
	color: var(--cma-book-muted);
	line-height: 1.5;
}

.cma-book__form {
	max-width: 760px;
	margin: 0 auto;
}

.cma-book__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem 1.25rem;
}

.cma-book__field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-size: 0.9rem;
	font-weight: 600;
}

.cma-book__field--full,
.cma-book__field--slots {
	grid-column: 1 / -1;
}

.cma-book__field input,
.cma-book__field select,
.cma-book__field textarea {
	font: inherit;
	font-weight: 400;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--cma-book-line);
	border-radius: 6px;
	background: #fff;
	color: var(--cma-book-ink);
}

.cma-book__field input:focus,
.cma-book__field select:focus,
.cma-book__field textarea:focus {
	outline: 2px solid rgba(31, 107, 138, 0.35);
	outline-offset: 1px;
	border-color: var(--cma-book-accent);
}

.cma-book__field--dates .cma-book__dates,
.cma-book__slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
	gap: 0.55rem;
	min-height: 3rem;
	padding: 0.85rem;
	border: 1px solid var(--cma-book-line);
	border-radius: 12px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 248, 251, 0.9));
}

.cma-book__dates {
	grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr));
}

.cma-book__dates-hint,
.cma-book__slots-hint {
	grid-column: 1 / -1;
	margin: 0;
	font-weight: 400;
	color: var(--cma-book-muted);
	font-size: 0.88rem;
	text-align: center;
	padding: 0.5rem 0;
}

.cma-book__date,
.cma-book__slot {
	appearance: none;
	border: 1px solid transparent;
	background: #fff;
	border-radius: 10px;
	padding: 0.7rem 0.4rem 0.55rem;
	font: inherit;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.01em;
	cursor: pointer;
	color: var(--cma-book-ink);
	box-shadow: 0 1px 0 rgba(34, 49, 63, 0.04), 0 0 0 1px var(--cma-book-line);
	transition:
		transform 0.15s ease,
		background 0.15s ease,
		color 0.15s ease,
		box-shadow 0.15s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.15rem;
}

.cma-book__date-wd {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--cma-book-muted);
	line-height: 1;
}

.cma-book__date-label {
	font-size: 1.05rem;
	line-height: 1.15;
	font-weight: 700;
}

.cma-book__slot-time {
	font-size: 0.98rem;
	line-height: 1.1;
}

.cma-book__slot-dur {
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--cma-book-muted);
}

.cma-book__date:hover,
.cma-book__slot:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(31, 107, 138, 0.12), 0 0 0 1px var(--cma-book-accent);
	color: var(--cma-book-accent);
}

.cma-book__date.is-selected,
.cma-book__slot.is-selected {
	background: linear-gradient(160deg, var(--cma-book-accent) 0%, var(--cma-book-accent-2) 100%);
	color: #fff;
	box-shadow: 0 10px 22px rgba(31, 107, 138, 0.28);
	transform: translateY(-1px);
}

.cma-book__date.is-selected .cma-book__date-wd,
.cma-book__slot.is-selected .cma-book__slot-dur {
	color: rgba(255, 255, 255, 0.85);
}

.cma-book__msg {
	margin: 1rem 0 0;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	font-size: 0.92rem;
}

.cma-book__msg.is-error {
	background: #fdeeee;
	color: #9b1c1c;
}

.cma-book__msg.is-ok {
	background: #e8f6ed;
	color: #1b6b3a;
}

.cma-book__submit {
	margin-top: 1.25rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 220px;
}

.cma-book__submit:disabled {
	opacity: 0.65;
	cursor: wait;
}

@media (max-width: 640px) {
	.cma-book__grid {
		grid-template-columns: 1fr;
	}
}
