/**
 * NG Prenotazioni — stile del widget di prenotazione e del modulo contatti.
 * Usa le variabili CSS del tema (se presenti) con fallback sui token del brand.
 */

.ng-widget {
	--ngp-verde-ink: var(--verde-ink, #1E3527);
	--ngp-verde: var(--verde, #2E5B3F);
	--ngp-verde-soft: var(--verde-soft, #7FA98C);
	--ngp-oro: var(--oro, #C39A3B);
	--ngp-oro-chiaro: var(--oro-chiaro, #E9D5A3);
	--ngp-crema: var(--crema, #FAF6EE);
	--ngp-bianco: var(--bianco, #FFFFFF);
	--ngp-testo: var(--testo, #33403A);
	--ngp-muted: var(--testo-muted, #6B7A70);

	background: var(--ngp-bianco);
	border: 1px solid var(--ngp-oro-chiaro);
	border-radius: 18px;
	box-shadow: 0 12px 32px rgba(30, 53, 39, 0.08);
	padding: clamp(1.25rem, 3vw, 2rem);
	color: var(--ngp-testo);
	max-width: 720px;
	margin: 0 auto;
	line-height: 1.6;
}

.ng-widget * {
	box-sizing: border-box;
}

.ng-intro {
	margin-bottom: 1.25rem;
	color: var(--ngp-testo);
}

.ng-intro p {
	margin: 0 0 0.75em;
}

.ng-intro p:last-child {
	margin-bottom: 0;
}

/* ---------- Esito (successo / errore) ---------- */

.ng-esito {
	display: none;
	margin: 0 0 1.25rem;
	padding: 0.9rem 1.1rem;
	border-radius: 12px;
	font-weight: 600;
}

.ng-esito.is-visible {
	display: block;
}

.ng-esito--ok {
	background: #E8F3EC;
	border: 1px solid var(--ngp-verde-soft);
	color: var(--ngp-verde-ink);
}

.ng-esito--errore {
	background: #FBEDEC;
	border: 1px solid #E3B7B3;
	color: #7C2D26;
}

/* ---------- Honeypot ---------- */

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

/* ---------- Step ---------- */

.ngp-step {
	border: 0;
	padding: 0;
	margin: 0 0 1.5rem;
	min-width: 0;
}

.ngp-step > legend {
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--ngp-verde-ink);
	margin-bottom: 0.75rem;
	padding: 0;
}

.ngp-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6em;
	height: 1.6em;
	margin-right: 0.4em;
	border-radius: 999px;
	background: var(--ngp-verde);
	color: var(--ngp-bianco);
	font-size: 0.85em;
}

/* ---------- Navigazione settimana ---------- */

.ng-week-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.ng-week-label {
	font-weight: 600;
	color: var(--ngp-muted);
	text-align: center;
}

.ng-week-btn {
	display: inline-block;
	padding: 0.35rem 0.9rem;
	border: 1px solid var(--ngp-oro-chiaro);
	border-radius: 999px;
	background: var(--ngp-crema);
	color: var(--ngp-verde);
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.ng-week-btn:hover:not(.is-disabled) {
	border-color: var(--ngp-oro);
	background: var(--ngp-bianco);
}

.ng-week-btn:focus-visible {
	outline: 3px solid var(--ngp-oro);
	outline-offset: 2px;
}

.ng-week-btn.is-disabled,
.ng-week-btn:disabled {
	opacity: 0.4;
	cursor: default;
	pointer-events: none;
}

/* ---------- Selettore giorni ---------- */

.ng-days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 0.4rem;
}

.ng-day {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.05rem;
	padding: 0.55rem 0.15rem;
	border: 1px solid var(--ngp-oro-chiaro);
	border-radius: 12px;
	background: var(--ngp-crema);
	color: inherit;
	font: inherit;
	line-height: 1.25;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ng-day:hover:not(.is-disabled):not(.is-selected) {
	border-color: var(--ngp-oro);
	background: var(--ngp-bianco);
}

.ng-day:focus-visible {
	outline: 3px solid var(--ngp-oro);
	outline-offset: 2px;
}

.ng-day.is-selected {
	background: var(--ngp-verde);
	border-color: var(--ngp-verde);
	color: var(--ngp-bianco);
}

.ng-day.is-disabled {
	opacity: 0.4;
	cursor: default;
	pointer-events: none;
}

.ng-day-dow {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.8;
}

.ng-day-num {
	font-weight: 700;
	font-size: 1.1rem;
}

.ng-day-mese {
	font-size: 0.72rem;
	opacity: 0.8;
}

/* ---------- Griglia slot orari ---------- */

.ng-slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
	gap: 0.5rem;
}

.ng-slot {
	position: relative;
	display: block;
	margin: 0;
}

.ng-slot input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.ng-slot span {
	display: block;
	text-align: center;
	padding: 0.5rem 0.25rem;
	border: 1.5px solid var(--ngp-verde-soft);
	border-radius: 999px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ng-slot span:hover {
	border-color: var(--ngp-verde);
	background: var(--ngp-crema);
}

.ng-slot input:checked + span {
	background: var(--ngp-verde);
	border-color: var(--ngp-verde);
	color: var(--ngp-bianco);
}

.ng-slot input:focus-visible + span {
	outline: 3px solid var(--ngp-oro);
	outline-offset: 2px;
}

.ng-slots-empty {
	margin: 0;
	padding: 0.75rem 1rem;
	border-radius: 12px;
	background: var(--ngp-crema);
	color: var(--ngp-muted);
}

/* ---------- Campi del modulo ---------- */

.ng-field {
	margin: 0 0 1rem;
	border: 0;
	padding: 0;
	min-width: 0;
}

.ng-field > label,
.ng-field > legend {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
	color: var(--ngp-verde-ink);
	padding: 0;
}

.ng-req {
	color: var(--ngp-oro);
}

.ng-widget input[type="text"],
.ng-widget input[type="email"],
.ng-widget input[type="tel"],
.ng-widget textarea {
	width: 100%;
	padding: 0.65rem 0.85rem;
	border: 1px solid var(--ngp-oro-chiaro);
	border-radius: 12px;
	background: var(--ngp-bianco);
	color: var(--ngp-testo);
	font: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ng-widget input[type="text"]:focus,
.ng-widget input[type="email"]:focus,
.ng-widget input[type="tel"]:focus,
.ng-widget textarea:focus {
	border-color: var(--ngp-verde);
	box-shadow: 0 0 0 3px rgba(46, 91, 63, 0.15);
	outline: none;
}

.ng-widget input:focus-visible,
.ng-widget textarea:focus-visible {
	outline: 3px solid var(--ngp-oro);
	outline-offset: 1px;
}

.ng-hint {
	margin: 0.3rem 0 0;
	font-size: 0.85rem;
	color: var(--ngp-muted);
}

/* Radio modalità */

.ng-modalita {
	display: block;
}

.ng-radio {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0.15rem 1.25rem 0.15rem 0;
	font-weight: 500;
	cursor: pointer;
}

.ng-radio input {
	accent-color: var(--ngp-verde);
	width: 1.1rem;
	height: 1.1rem;
}

.ng-radio input:focus-visible {
	outline: 3px solid var(--ngp-oro);
	outline-offset: 2px;
}

/* Checkbox privacy */

.ng-check {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	font-weight: 400;
	font-size: 0.9rem;
	cursor: pointer;
}

.ng-check input {
	margin-top: 0.25rem;
	flex: 0 0 auto;
	accent-color: var(--ngp-verde);
	width: 1.1rem;
	height: 1.1rem;
}

.ng-check input:focus-visible {
	outline: 3px solid var(--ngp-oro);
	outline-offset: 2px;
}

.ng-check a {
	color: var(--ngp-verde);
	text-decoration: underline;
}

.ng-check a:hover {
	color: var(--ngp-oro);
}

/* ---------- Bottone ---------- */

.ng-actions {
	margin: 1.25rem 0 0;
}

.ng-widget .ng-btn {
	display: inline-block;
	padding: 0.85rem 1.8rem;
	border: 0;
	border-radius: 999px;
	background: var(--ngp-verde);
	color: var(--ngp-bianco);
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}

.ng-widget .ng-btn:hover:not(:disabled) {
	background: var(--ngp-verde-ink);
}

.ng-widget .ng-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.ng-widget .ng-btn:focus-visible {
	outline: 3px solid var(--ngp-oro);
	outline-offset: 2px;
}

.ng-widget .ng-btn:disabled {
	opacity: 0.65;
	cursor: wait;
}

.ng-note {
	margin: 0.75rem 0 0;
	font-size: 0.85rem;
	color: var(--ngp-muted);
}

/* ---------- Stato di caricamento ---------- */

.ng-widget.is-loading .ng-days,
.ng-widget.is-loading .ng-slots {
	opacity: 0.5;
	pointer-events: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
	.ng-widget {
		border-radius: 14px;
	}

	.ng-days {
		gap: 0.25rem;
	}

	.ng-day {
		padding: 0.4rem 0.1rem;
		border-radius: 10px;
	}

	.ng-day-num {
		font-size: 1rem;
	}

	.ng-slots {
		grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
	}

	.ng-week-nav {
		flex-wrap: wrap;
		justify-content: center;
	}
}
