/* AGIS - interfaccia di votazione */
@import url("https://fonts.googleapis.com/css2?family=Gilda+Display&family=Roboto:wght@400;500;600;700&display=swap");

:root {
	--agis-green-900: #26372b;
	--agis-green-800: #354a3a;
	--agis-green-700: #4f6754;
	--agis-green-600: #657c69;
	--agis-green-200: #dce5dd;
	--agis-green-100: #edf2ed;
	--agis-green-050: #f6f8f6;
	--agis-red: #d62f35;
	--agis-red-dark: #ae2227;
	--agis-text: #243028;
	--agis-muted: #647168;
	--agis-border: #d8e0d9;
	--agis-white: #ffffff;
	--agis-radius-sm: 10px;
	--agis-radius: 16px;
	--agis-radius-lg: 22px;
	--agis-shadow-sm: 0 5px 16px rgba(34, 51, 39, 0.07);
	--agis-shadow: 0 14px 38px rgba(34, 51, 39, 0.10);
}

html {
	background: var(--agis-green-050);
	scroll-behavior: smooth;
}

body {
	margin: 0;
	padding: 0;
	background: var(--agis-green-050);
	color: var(--agis-text);
	font-family: "Roboto", sans-serif;
	font-size: 17px;
	font-weight: 400;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

a:link,
a:visited {
	color: var(--agis-green-800);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:hover {
	color: var(--agis-red-dark);
}

/* Gilda Display e' riservato esclusivamente al titolo principale. */
h1 {
	margin: 0;
	padding: 0 0 18px;
	color: var(--agis-red);
	font-family: "Gilda Display", serif;
	font-size: clamp(2rem, 4vw, 3.25rem);
	font-weight: 400;
	line-height: 1.12;
	letter-spacing: -0.02em;
}

h2,
h3,
h4,
h5,
h6 {
	font-family: "Roboto", sans-serif;
	color: var(--agis-text);
	font-weight: 600;
	line-height: 1.3;
}

h2 {
	font-size: 1.5rem;
}

h3 {
	font-size: 1.35rem;
}

h4 {
	margin: 34px 0 12px;
	padding: 0;
	color: var(--agis-green-800);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.025em;
	text-align: left;
	text-transform: uppercase;
}

p {
	margin-top: 0;
	margin-bottom: 1rem;
}

b,
strong {
	font-family: "Roboto", sans-serif;
	font-weight: 700;
	color: var(--agis-green-900);
}

hr {
	margin: 26px 0 6px;
	border: 0;
	border-bottom: 1px solid var(--agis-border);
}

/* Header */
.cs-header {
	margin-bottom: 34px;
	padding: 0 0 22px;
	background: rgba(255, 255, 255, 0.94);
	border-bottom: 1px solid var(--agis-border);
	box-shadow: 0 4px 18px rgba(34, 51, 39, 0.05);
}

.cs-header > .container {
	padding-top: 18px;
	padding-bottom: 18px;
}

.cs-header .row {
	align-items: center;
}

.cs-header h3 {
	margin: 0;
	padding: 0;
	color: var(--agis-muted);
	font-family: "Roboto", sans-serif;
	font-size: clamp(0.86rem, 2.1vw, 1.15rem);
	font-weight: 500;
	letter-spacing: 0.025em;
	line-height: 1.35;
}

.cs-header h3 > strong {
	display: inline-block;
	margin-right: 6px;
	color: var(--agis-green-900);
	font-weight: 700;
}

.cs-header img {
	width: 78px;
	height: auto;
}

/* Barra di avanzamento ricavata dalle classi degli step gia' presenti. */
.cs-head {
	--agis-progress: 20%;
	position: relative;
	display: flex;
	align-items: center;
	height: 46px;
	width: calc(100% - 30px);
	margin-right: auto;
	margin-left: auto;
	padding: 0 22px;
	overflow: hidden;
	background: var(--agis-green-200);
	border: 1px solid #d3ddd4;
	border-radius: 999px;
	color: var(--agis-white);
	box-shadow: inset 0 1px 2px rgba(30, 45, 34, 0.08);
}

.cs-head::before {
	position: absolute;
	inset: 0 auto 0 0;
	width: max(var(--agis-progress), 120px);
	background: linear-gradient(90deg, var(--agis-green-800), var(--agis-green-600));
	border-radius: inherit;
	content: "";
	transition: width 0.25s ease;
}

.cs-head-1 { --agis-progress: 20%; }
.cs-head-2 { --agis-progress: 40%; }
.cs-head-3 { --agis-progress: 60%; }
.cs-head-4 { --agis-progress: 80%; }
.cs-head-5 { --agis-progress: 100%; }

.cs-head h2 {
	position: relative;
	z-index: 1;
	margin: 0;
	padding: 0;
	color: var(--agis-white) !important;
	font-family: "Roboto", sans-serif;
	font-size: 0.87rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	line-height: 1;
	text-transform: uppercase;
}

@media (min-width: 576px) {
	.cs-head { max-width: 540px; }
}

@media (min-width: 768px) {
	.cs-head { max-width: 720px; }
}

@media (min-width: 992px) {
	.cs-head { max-width: 960px; }
}

@media (min-width: 1200px) {
	.cs-head { max-width: 1140px; }
}

/* Contenuto della votazione */
#idForm main {
	margin-bottom: 120px;
}

#idForm main > .container {
	padding: clamp(24px, 4vw, 48px);
	background: var(--agis-white);
	border: 1px solid var(--agis-border);
	border-radius: var(--agis-radius-lg);
	box-shadow: var(--agis-shadow);
}

#idForm main > .container > .row:first-child p {
	max-width: 900px;
	color: #46534a;
	font-size: 1.03rem;
	line-height: 1.75;
}

#idForm main > .container > .row:nth-child(2) > [class*="col-"] {
	margin-top: 36px !important;
}

/* Etichette di sezione e aiuti */
.btnSmartHelp {
	display: flex;
	align-items: center;
	width: 100%;
	margin: 0;
	padding: 12px 15px;
	background: #fff7f7;
	border: 1px solid #f0d5d6;
	border-radius: var(--agis-radius-sm);
	color: var(--agis-red-dark);
	cursor: pointer;
	font-size: 0.92rem;
	font-weight: 700;
	letter-spacing: 0.025em;
}

.btnSmartHelp .fas {
	margin-right: 9px;
	font-size: 1rem;
}

.btnSmartHelp label {
	margin: 0;
	cursor: pointer;
}

.cs-help {
	display: none;
	margin-top: 7px;
	padding: 13px 15px;
	background: var(--agis-green-100);
	border: 1px solid var(--agis-border);
	border-radius: var(--agis-radius-sm);
	color: #526057;
	font-size: 0.88rem;
	line-height: 1.55;
}

/* Ogni candidato diventa una superficie ampia e facilmente selezionabile. */
#idForm .form-check {
	position: relative;
	display: flex;
	align-items: flex-start;
	min-height: 58px;
	margin: 0 0 10px;
	padding: 13px 16px;
	background: var(--agis-white);
	border: 1px solid var(--agis-border);
	border-radius: 13px;
	font-size: 0.98rem;
	line-height: 1.4;
	transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

#idForm .form-check:hover {
	background: #fbfcfb;
	border-color: #aebcaf;
	box-shadow: var(--agis-shadow-sm);
	transform: translateY(-1px);
}

#idForm .form-check:has(.form-check-input:checked) {
	background: var(--agis-green-100);
	border-color: var(--agis-green-600);
	box-shadow: 0 0 0 3px rgba(101, 124, 105, 0.12);
}

#idForm .form-check-input {
	position: relative;
	flex: 0 0 auto;
	width: 19px;
	height: 19px;
	margin: 2px 12px 0 0;
	accent-color: var(--agis-green-700);
	cursor: pointer;
}

#idForm .form-check-input:focus-visible {
	outline: 3px solid rgba(214, 47, 53, 0.25);
	outline-offset: 3px;
}

#idForm .form-check-label {
	flex: 1 1 auto;
	margin: 0;
	color: var(--agis-text);
	cursor: pointer;
	font-weight: 600;
}

#idForm .form-check-input:checked + .form-check-label {
	color: var(--agis-green-900);
}

#idForm .form-check .cssGrey {
	display: inline-block;
	margin-top: 3px;
	color: var(--agis-muted);
	font-size: 0.82rem !important;
	font-weight: 400;
}

.cssItems {
	margin-bottom: 8px;
}

.cssGrey {
	color: var(--agis-muted);
}

.fa-green {
	color: var(--agis-green-700);
}

.btnGo {
	color: var(--agis-red-dark);
	cursor: pointer;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* Preferenze selezionate e riepilogo */
#idForm .cssCandidatiSelezionati {
	min-height: 78px;
	margin: 14px 0 0;
	padding: 18px;
	background: var(--agis-green-100);
	border: 1px solid #d4ded5;
	border-radius: var(--agis-radius);
	color: var(--agis-green-900);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.55;
}

#idForm .riepilogo {
	margin-bottom: 22px;
	padding: 20px;
	background: var(--agis-white);
	border: 1px solid var(--agis-border);
	border-radius: var(--agis-radius);
	box-shadow: var(--agis-shadow-sm);
}

#idForm .riepilogo .cssCandidatiSelezionati {
	min-height: 0;
	margin-top: 12px;
}

/* Campi e messaggi */
.form-control {
	min-height: 46px;
	padding: 10px 13px;
	background: var(--agis-white);
	border: 1px solid var(--agis-border);
	border-radius: var(--agis-radius-sm);
	color: var(--agis-text);
}

.form-control:focus {
	background: var(--agis-white);
	border-color: var(--agis-green-600);
	box-shadow: 0 0 0 3px rgba(101, 124, 105, 0.14);
	color: var(--agis-text);
	outline: 0;
}

.input-group-text {
	background: var(--agis-green-100);
	border: 1px solid var(--agis-border);
	border-radius: var(--agis-radius-sm);
}

#idForm .alert,
#idForm .cssError {
	padding: 20px;
	background: #fff7f7;
	border: 1px solid #edb8ba;
	border-radius: var(--agis-radius);
	color: var(--agis-red-dark);
	box-shadow: var(--agis-shadow-sm);
}

#idForm .alert ul,
#idForm .alert ol {
	padding-left: 1.4rem;
}

/* Pulsanti */
.btn-success,
.btn-danger {
	min-height: 48px;
	padding: 11px 22px;
	border-radius: 12px;
	font-family: "Roboto", sans-serif;
	font-size: 0.9rem;
	font-weight: 700;
	letter-spacing: 0.035em;
	white-space: normal;
	box-shadow: 0 5px 13px rgba(38, 55, 43, 0.14);
	transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn-success {
	background: var(--agis-green-700);
	border-color: var(--agis-green-700);
	color: var(--agis-white);
}

.btn-success:hover,
.btn-success:focus,
.btn-success:not(:disabled):not(.disabled).active,
.btn-success:not(:disabled):not(.disabled):active,
.show > .btn-success.dropdown-toggle {
	background: var(--agis-green-900);
	border-color: var(--agis-green-900);
	box-shadow: 0 7px 18px rgba(38, 55, 43, 0.22);
	color: var(--agis-white);
	transform: translateY(-1px);
}

.btn-success-dark {
	background: var(--agis-green-900) !important;
	border-color: var(--agis-green-900) !important;
}

.btn-success-dark:hover,
.btn-success-dark:focus {
	background: #17231a !important;
	border-color: #17231a !important;
}

.btn-danger {
	background: var(--agis-red);
	border-color: var(--agis-red);
	color: var(--agis-white);
}

.btn-danger:hover,
.btn-danger:focus {
	background: var(--agis-red-dark);
	border-color: var(--agis-red-dark);
	color: var(--agis-white);
}

.btn:focus-visible,
.btnGo:focus-visible,
.btnSmartHelp:focus-visible {
	outline: 3px solid rgba(214, 47, 53, 0.28);
	outline-offset: 3px;
}

/* Footer com azioni sempre disponibili. */
.cs-footer {
	position: fixed;
	z-index: 10;
	right: 0;
	bottom: 0;
	left: 0;
	width: 100%;
	min-height: 72px;
	margin: 0;
	padding: 12px 0 0;
	background: rgba(255, 255, 255, 0.96);
	border-top: 1px solid var(--agis-border);
	box-shadow: 0 -8px 24px rgba(34, 51, 39, 0.08);
	color: var(--agis-text);
	backdrop-filter: blur(8px);
}

.cs-footer .btn {
	margin-bottom: 12px !important;
}

::placeholder {
	color: #7b887f !important;
	font-family: "Roboto", sans-serif !important;
}

input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
	background-color: var(--agis-white) !important;
	background-image: none !important;
}

@media (min-width: 992px) {
	#idForm main > .container > .row:nth-child(2) > .col-lg-4 {
		position: sticky;
		top: 24px;
		align-self: flex-start;
	}
}

@media (max-width: 767.98px) {
	body {
		font-size: 16px;
	}

	.cs-header {
		margin-bottom: 18px;
		padding-bottom: 15px;
	}

	.cs-header > .container {
		padding-top: 10px;
		padding-bottom: 10px;
	}

	.cs-header img {
		width: 60px;
	}

	.cs-head {
		height: 42px;
		padding-right: 16px;
		padding-left: 16px;
	}

	#idForm main {
		margin-bottom: 105px;
	}

	#idForm main > .container {
		width: calc(100% - 24px);
		padding: 24px 18px;
		border-radius: 18px;
	}

	h1 {
		font-size: clamp(1.85rem, 9vw, 2.45rem);
	}

	#idForm main > .container > .row:nth-child(2) > [class*="col-"] {
		margin-top: 26px !important;
	}

	#idForm .form-check {
		padding: 12px 13px;
	}

	#idForm .riepilogo {
		padding: 15px;
	}

	.btn-success,
	.btn-danger {
		min-height: 46px;
		padding-right: 16px;
		padding-left: 16px;
		font-size: 0.78rem;
	}

	.cs-footer {
		min-height: 68px;
		padding-top: 10px;
	}
}

@media (max-width: 399px) {
	.cs-header h3 {
		font-size: 0.76rem;
	}

	.cs-header h3 > strong {
		display: block;
		margin-right: 0;
	}

	.cs-header img {
		width: 52px;
	}

	#idForm main > .container {
		width: calc(100% - 16px);
		padding-right: 14px;
		padding-left: 14px;
	}

	.cs-footer .container {
		padding-right: 10px;
		padding-left: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
