/* Kiosk ingresso — pensato per tablet, utenti non tecnici. */
.ag-kiosk {
	--ag-ink: #0f2e2b;
	--ag-paper: #ffffff;
	--ag-muted: #5b6b69;
	--ag-line: #e3e8e6;
	--ag-go: #1f9d55;      /* entrata */
	--ag-back: #2f5fd0;    /* uscita */
	--ag-error: #c0392b;
	box-sizing: border-box;
	min-height: 100vh;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	overflow-x: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ag-ink);
	padding: 24px;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.ag-kiosk *, .ag-kiosk *::before, .ag-kiosk *::after { box-sizing: border-box; }

.ag-kiosk__panel {
	width: 100%;
	max-width: 460px;
	background: var(--ag-paper);
	border-radius: 20px;
	padding: 32px 28px 36px;
	text-align: center;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}

.ag-kiosk__title {
	margin: 0 0 6px;
	font-size: 30px;
	font-weight: 800;
	color: var(--ag-ink);
	letter-spacing: -.02em;
}
.ag-kiosk__hint {
	margin: 0 0 22px;
	font-size: 16px;
	color: var(--ag-muted);
	line-height: 1.4;
}

.ag-kiosk__pin {
	height: 52px;
	margin-bottom: 20px;
	font-size: 38px;
	font-weight: 700;
	letter-spacing: 14px;
	color: var(--ag-ink);
	display: flex;
	align-items: center;
	justify-content: center;
}

.ag-kiosk__pad {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}
.ag-key {
	appearance: none;
	border: 1px solid var(--ag-line);
	background: #f6f8f7;
	color: var(--ag-ink);
	font-size: 26px;
	font-weight: 600;
	padding: 20px 0;
	border-radius: 14px;
	cursor: pointer;
	transition: transform .05s ease, background .15s ease;
	touch-action: manipulation;
}
.ag-key:active { transform: scale(.96); background: #eceeed; }
.ag-key--fn { color: var(--ag-error); }
.ag-key--ok { background: var(--ag-go); color: #fff; border-color: var(--ag-go); }

/* Esito: overlay popup sopra il tastierino */
.ag-kiosk__overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, .55);
}
/* display:flex qui sopra sovrascrive la regola browser [hidden]{display:none}:
   ripristino il nascondimento quando l'attributo hidden è presente. */
.ag-kiosk__overlay[hidden] { display: none; }
.ag-result__card {
	width: 100%;
	max-width: 420px;
	background: var(--ag-paper);
	border-radius: 20px;
	padding: 32px 28px 36px;
	text-align: center;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
}
.ag-result__badge {
	width: 84px; height: 84px;
	margin: 4px auto 18px;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 44px; color: #fff;
}
.ag-kiosk--entrata .ag-result__badge { background: var(--ag-go); }
.ag-kiosk--uscita  .ag-result__badge { background: var(--ag-back); }
.ag-kiosk--errore  .ag-result__badge { background: var(--ag-error); }

.ag-result__name { font-size: 26px; font-weight: 800; color: var(--ag-ink); margin-bottom: 6px; }
.ag-result__meta { font-size: 17px; color: var(--ag-muted); }

.ag-attivita { margin-top: 24px; border-top: 1px solid var(--ag-line); padding-top: 20px; }
.ag-attivita__q { font-size: 18px; font-weight: 600; color: var(--ag-ink); margin: 0 0 14px; }
.ag-attivita__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ag-attivita__btn {
	appearance: none; border: 1px solid var(--ag-line); background: #f6f8f7;
	color: var(--ag-ink); font-size: 15px; font-weight: 600; padding: 14px 8px;
	border-radius: 12px; cursor: pointer; touch-action: manipulation;
}
.ag-attivita__btn:active { transform: scale(.97); }

@media (prefers-reduced-motion: reduce) {
	.ag-key, .ag-attivita__btn { transition: none; }
}

/* Blocco scanner fotocamera (condiviso kiosk + appello) */
.ag-scan { margin: 0 0 18px; }
.ag-scan__btn {
	appearance: none; border: 1px solid #cfe6d8; background: #eafaf0;
	color: #0f2e2b; font-size: 16px; font-weight: 600;
	padding: 12px 18px; border-radius: 12px; cursor: pointer;
	touch-action: manipulation; width: 100%;
}
.ag-scan__btn:disabled { opacity: .6; cursor: not-allowed; background: #f1f3f2; border-color: #e3e8e6; }
.ag-scan__reader {
	margin-top: 12px; border-radius: 14px; overflow: hidden;
	background: #000; max-width: 320px; margin-left: auto; margin-right: auto;
}
.ag-scan__reader video { display: block; width: 100%; height: auto; }
