/* prenotazione_eventi - stile comune */
:root {
	--blu: #003466;
	--blu-medio: #0b4f8a;
	--azzurro: #e8f0f8;
	--accento: #e8a33d;
	--testo: #1d2733;
	--grigio: #5b6875;
	--bordo: #dde3ea;
	--raggio: 14px;
	--bs-primary: #0b4f8a;
	--bs-primary-rgb: 11, 79, 138;
	--bs-font-sans-serif: "Titillium Web", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
	background: #f3f6f9;
	color: var(--testo);
	font-family: var(--bs-font-sans-serif);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.btn-primary {
	--bs-btn-bg: var(--blu-medio);
	--bs-btn-border-color: var(--blu-medio);
	--bs-btn-hover-bg: var(--blu);
	--bs-btn-hover-border-color: var(--blu);
	--bs-btn-active-bg: var(--blu);
	font-weight: 600;
}
.btn-outline-primary {
	--bs-btn-color: var(--blu-medio);
	--bs-btn-border-color: var(--blu-medio);
	--bs-btn-hover-bg: var(--blu-medio);
	--bs-btn-hover-border-color: var(--blu-medio);
}
.form-control:focus, .form-select:focus {
	border-color: var(--blu-medio);
	box-shadow: 0 0 0 .2rem rgba(11, 79, 138, .2);
}

/* TESTATA */
.testata {
	background: linear-gradient(135deg, var(--blu) 0%, var(--blu-medio) 100%);
	color: #fff;
	padding-bottom: 2.75rem;
	position: relative;
}
.testata-logo {
	height: 56px;
	background: var(--blu) url(../immagini/RM3_header.jpeg) no-repeat left center;
	background-size: auto 56px;
	border-bottom: 3px solid var(--accento);
}
.testata-titolo { padding-top: .6rem; }
.testata-titolo h1 { font-weight: 700; font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 0; }
.testata-titolo p { display: none; }

.contenuto {
	max-width: 1000px;
	margin-top: -2rem;
	position: relative; /* sopra la testata, che e' posizionata per la versione */
	flex: 1;
	padding-bottom: 2rem;
}
.piede { text-align: center; color: var(--grigio); font-size: .85rem; padding: 1rem; }

/* RIQUADRI */
.riquadro {
	background: #fff;
	border-radius: var(--raggio);
	box-shadow: 0 6px 24px rgba(0, 32, 64, .08);
	padding: 1.25rem;
	margin-bottom: 1.25rem;
}
.riquadro h2 { font-size: 1.25rem; font-weight: 700; }
.etichetta-sezione {
	text-transform: uppercase;
	letter-spacing: .06em;
	font-size: .78rem;
	font-weight: 700;
	color: var(--grigio);
	margin-bottom: .4rem;
}

/* BARRA UTENTE */
.barra-utente { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.avatar {
	width: 44px; height: 44px; border-radius: 50%;
	background: var(--azzurro); color: var(--blu);
	display: flex; align-items: center; justify-content: center;
	font-weight: 700; flex-shrink: 0;
}
.barra-utente .chi { flex: 1; min-width: 0; line-height: 1.25; }
.barra-utente .chi small { color: var(--grigio); overflow-wrap: anywhere; }

.schede-vista { gap: .4rem; margin-top: 1rem; }
.schede-vista .nav-link { border-radius: 999px; color: var(--blu-medio); font-weight: 600; }
.schede-vista .nav-link.active { background: var(--blu-medio); }
.schede-vista .a-capo { flex-basis: 100%; height: 0; }

/* SCELTA EVENTO */
.scelta-evento .form-select { font-size: 1.1rem; font-weight: 600; padding: .7rem 1rem; border-radius: 10px; }

/* SCHEDA EVENTO */
.evento { padding: 0; overflow: hidden; }
.evento-testa {
	display: flex; gap: 1rem; align-items: center;
	padding: 1.25rem; border-bottom: 1px solid var(--bordo);
}
.data-evento {
	flex-shrink: 0; width: 76px; text-align: center;
	background: var(--blu); color: #fff; border-radius: 12px; padding: .5rem 0;
}
.data-evento .giorno { font-size: 2rem; font-weight: 700; line-height: 1; }
.data-evento .mese { font-size: .8rem; letter-spacing: .1em; color: var(--accento); font-weight: 700; }
.data-evento .anno { font-size: .75rem; opacity: .8; }
.evento-testa h2 { margin: 0; font-size: clamp(1.25rem, 3.5vw, 1.6rem); }
.evento-corpo { padding: 1.25rem; }
.dettagli { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .4rem; }
.dettagli i { color: var(--blu-medio); margin-right: .45rem; }
.descrizione { color: #39444f; white-space: pre-line; }

.disponibilita { margin: 1.25rem 0; }
.disponibilita .progress { height: 10px; border-radius: 999px; background: var(--azzurro); }
.disponibilita .progress-bar { background: linear-gradient(90deg, var(--blu-medio), #2f8ad0); }
.disponibilita.quasi-pieno .progress-bar { background: linear-gradient(90deg, #d9822b, var(--accento)); }
.disponibilita.pieno .progress-bar { background: #c0392b; }

.azione-evento { background: var(--azzurro); border-radius: 12px; padding: 1rem; }
.azione-evento .btn-lg { width: 100%; }
.stato { display: flex; gap: .75rem; align-items: center; }
.stato i { font-size: 2rem; }
.stato.confermato i { color: #198754; }
.stato.riserva i { color: #d9822b; }

/* INVITI VIP */
.vip { border-top: 4px solid var(--accento); }
.contatore-inviti { font-size: 2rem; font-weight: 700; color: var(--blu); line-height: 1; }
.lista-inviti .list-group-item { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.lista-inviti .chi { flex: 1; min-width: 180px; overflow-wrap: anywhere; }
.lista-inviti .persone { font-weight: 700; color: var(--blu); white-space: nowrap; }

/* ACCESSO */
.accesso .riquadro { height: 100%; }
.accesso .icona-grande { font-size: 2.2rem; color: var(--blu-medio); }

/* AMMINISTRAZIONE */
.tabella-gestione th { font-size: .8rem; text-transform: uppercase; color: var(--grigio); white-space: nowrap; }
.tabella-gestione td { vertical-align: middle; }
.elenco-scelta-eventi { max-height: 18rem; overflow-y: auto; border: 1px solid var(--bs-border-color); border-radius: 8px; padding: .5rem .75rem; }

/* MOBILE */
@media (max-width: 575.98px) {
	.contenuto { padding-left: 12px; padding-right: 12px; }
	.riquadro { padding: 1rem; border-radius: 12px; }
	.evento-testa, .evento-corpo { padding: 1rem; }
	.data-evento { width: 64px; }
	.data-evento .giorno { font-size: 1.6rem; }
	.schede-vista .nav-link { padding: .4rem .8rem; }
	.lista-inviti .azioni { width: 100%; display: flex; gap: .5rem; }
	.lista-inviti .azioni form, .lista-inviti .azioni .btn { flex: 1; }
	/* tabelle di gestione come schede impilate */
	.tabella-gestione thead { display: none; }
	.tabella-gestione tr { display: block; border: 1px solid var(--bordo); border-radius: 10px; margin-bottom: .75rem; padding: .5rem; }
	.tabella-gestione td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .25rem .25rem; text-align: right; }
	.tabella-gestione td::before { content: attr(data-etichetta); font-weight: 600; color: var(--grigio); text-align: left; }
	.tabella-gestione td.azioni { justify-content: flex-end; }
	.tabella-gestione td.azioni::before { content: none; }
}

/* schede della pagina di accesso: vanno a capo invece di scorrere */
.schede-accesso { gap: .4rem; }
.schede-accesso .nav-link { border-radius: 999px; color: var(--blu-medio); font-weight: 600; padding: .4rem .9rem; }
.schede-accesso .nav-link.active { background: var(--blu-medio); }

.testata-versione {
	position: absolute;
	top: calc(56px + 3px + .3rem); /* sotto la fascia del logo e il suo bordo */
	right: 1rem;
	font-size: .8rem;
	opacity: .75;
}
/* il floating label nasconde il placeholder: lo mostro quando l'etichetta e' salita */
.form-floating > .form-control:focus::placeholder { color: #9aa3ad; }

/* SCHERMATA PRENOTAZIONI COMPATTA: tutto in uno schermo senza scorrere.
   Vale solo dove c'e' la tendina degli eventi; la testata bassa e' invece per tutte. */
body:has(.scelta-evento) .contenuto { padding-bottom: 0; }
body:has(.scelta-evento) .piede { padding: .4rem; }
body:has(.scelta-evento) .riquadro { padding: .75rem 1rem; margin-bottom: .75rem; }
body:has(.scelta-evento) .avatar { width: 36px; height: 36px; font-size: .9rem; }
body:has(.scelta-evento) .schede-vista { margin-top: .5rem; }
body:has(.scelta-evento) .schede-vista .nav-link { padding: .25rem .8rem; }

/* etichetta e tendina sulla stessa riga */
.scelta-evento form { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.scelta-evento .etichetta-sezione { margin: 0; white-space: nowrap; }
.scelta-evento .form-select { flex: 1; min-width: 220px; font-size: 1rem; padding: .4rem 2.25rem .4rem .75rem; }

.evento-testa { padding: .75rem 1rem; }
.data-evento { width: 60px; padding: .3rem 0; border-radius: 10px; }
.data-evento .giorno { font-size: 1.5rem; }
.evento-corpo { padding: .75rem 1rem 1rem; }
.dettagli { margin-bottom: .5rem; gap: .2rem; }
.descrizione { margin-bottom: 0; }
.disponibilita { margin: 0 0 .75rem; }
.azione-evento { padding: .75rem; }

/* da tablet in su: dettagli a sinistra, disponibilita' e pulsante a destra */
.evento-prenota { margin-top: .75rem; }
@media (min-width: 768px) {
	.evento-corpo { display: flex; gap: 1.5rem; align-items: flex-start; }
	.evento-info { flex: 1; min-width: 0; }
	.evento-prenota { flex: 0 0 340px; margin-top: 0; }
}

/* VALIDAZIONE QR */
.esito-validazione { display: flex; align-items: center; gap: 1.2rem; }
.semaforo { flex: 0 0 auto; width: 96px; height: 96px; border-radius: 50%; background: #d5d9de; border: 4px solid #fff; box-shadow: 0 0 0 1px #c3c8ce; transition: background .15s; }
.semaforo-attesa { background: #f0c419; }
.semaforo-verde { background: #1e9e45; box-shadow: 0 0 0 1px #1e9e45, 0 0 28px rgba(30, 158, 69, .6); }
.semaforo-blu { background: #1f5fbf; box-shadow: 0 0 0 1px #1f5fbf, 0 0 28px rgba(31, 95, 191, .6); }
.semaforo-rosso { background: #d62828; box-shadow: 0 0 0 1px #d62828, 0 0 28px rgba(214, 40, 40, .6); }
.esito-testi { flex: 1 1 auto; min-width: 0; }
.esito-nominativo { font-size: 1.6rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.esito-messaggio { font-size: 1.1rem; font-weight: 600; margin-top: .3rem; }
.esito-persone { flex: 0 0 auto; text-align: center; }
.esito-persone small { display: block; color: #6c757d; }
.esito-persone b { font-size: 2.4rem; line-height: 1; }
.lettore-qr { width: 100%; max-width: 480px; margin: 0 auto; border-radius: 10px; overflow: hidden; }
.lettore-qr video { width: 100% !important; display: block; }
@media (max-width: 575px) {
	.semaforo { width: 72px; height: 72px; }
	.esito-nominativo { font-size: 1.3rem; }
}

/* Elenco presenze della Validazione QR: spunta nella prima colonna, a sinistra */
.elenco-presenze .spunta { width: 3.5rem; text-align: left; }
.pagina-validazione .elenco-presenze .spunta input[type="checkbox"] { width: 1.4rem; height: 1.4rem; cursor: pointer; }

/* Scheda Validazione QR su cellulare: caratteri grandi, si legge a colpo d'occhio all'ingresso */
@media (max-width: 767px) {
	.pagina-validazione { font-size: 1.35rem; }
	.pagina-validazione h2 { font-size: 1.8rem; }
	.pagina-validazione .etichetta-sezione,
	.pagina-validazione .form-label { font-size: 1.35rem; }
	.pagina-validazione .form-select,
	.pagina-validazione .form-control,
	.pagina-validazione .btn { font-size: 1.35rem; }
	.pagina-validazione .btn-sm { font-size: 1.1rem; }
	.pagina-validazione input[type="radio"],
	.pagina-validazione input[type="checkbox"] { width: 1.4rem; height: 1.4rem; vertical-align: middle; }
	.pagina-validazione .semaforo { width: 140px; height: 140px; }
	.pagina-validazione .esito-nominativo { font-size: 2.6rem; }
	.pagina-validazione .esito-messaggio { font-size: 1.7rem; }
	.pagina-validazione .esito-persone small { font-size: 1.2rem; }
	.pagina-validazione .esito-persone b { font-size: 3.6rem; }
	.pagina-validazione .tabella-gestione th { font-size: 1.05rem; }
	.pagina-validazione .tabella-gestione small { font-size: 1.1rem; }
	.elenco-presenze { font-size: 1.6rem; }
	.elenco-presenze th { font-size: 1.25rem !important; }
	.elenco-presenze small { font-size: 1.3rem !important; }
	.pagina-validazione .elenco-presenze .spunta input[type="checkbox"] { width: 2.4rem; height: 2.4rem; }
}
@media (max-width: 575px) {
	.pagina-validazione { font-size: 1.2rem; }
	.pagina-validazione .semaforo { width: 96px; height: 96px; }
	.pagina-validazione .esito-nominativo { font-size: 1.9rem; }
	.pagina-validazione .esito-messaggio { font-size: 1.35rem; }
	.elenco-presenze { font-size: 1.35rem; }
	.elenco-presenze td.spunta { justify-content: flex-start; }
	.elenco-presenze td.spunta::before { content: none; }
}
