/* ASD Attivamente Tesseramenti — Frontend form styles */

.at-form-wrap {
	max-width: 780px;
	margin: 0 auto;
	font-family: inherit;
}

.at-form-title {
	font-size: 1.6em;
	margin-bottom: 1.2em;
	color: inherit;
}

/* Notices */
.at-notice {
	padding: 1em 1.4em;
	border-radius: 4px;
	margin-bottom: 1.5em;
	border-left: 4px solid;
}

.at-notice-success {
	background: #edfaed;
	border-color: #46b450;
	color: #1d5e21;
}

.at-notice-error {
	background: #fdf3f3;
	border-color: #dc3232;
	color: #7a1414;
}

/* Fieldset */
.at-fieldset {
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 1.4em 1.6em;
	margin-bottom: 1.6em;
}

.at-fieldset legend {
	font-weight: 600;
	font-size: 1.05em;
	padding: 0 .5em;
	color: inherit;
}

/* Rows */
.at-row {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	margin-bottom: 1em;
}

.at-row:last-child {
	margin-bottom: 0;
}

.at-row-2 .at-field {
	flex: 1 1 calc(50% - .5em);
	min-width: 180px;
}

.at-row-3 .at-field {
	flex: 1 1 calc(33% - .5em);
	min-width: 120px;
}

.at-field {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.at-field-grow {
	flex: 2;
}

.at-field-small {
	flex: 0 0 80px;
	min-width: 70px;
}

.at-field label {
	font-weight: 600;
	font-size: .9em;
	margin-bottom: .35em;
	color: inherit;
}

.at-field input[type="text"],
.at-field input[type="email"],
.at-field input[type="tel"],
.at-field input[type="date"],
.at-field input[type="number"],
.at-field input[type="file"],
.at-field select,
.at-field textarea {
	width: 100%;
	padding: .55em .75em;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 1em;
	transition: border-color .2s;
	box-sizing: border-box;
}

.at-field input:focus,
.at-field select:focus,
.at-field textarea:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0,115,170,.15);
}

.at-help {
	font-size: .82em;
	color: #888;
	margin-top: .3em;
}

/* Tipo tessera radio */
.at-radio-group {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
}

.at-radio-label {
	display: flex;
	align-items: center;
	gap: .4em;
	cursor: pointer;
	padding: .5em .9em;
	border: 2px solid #ddd;
	border-radius: 4px;
	transition: border-color .2s, background .2s;
	font-weight: normal;
}

.at-radio-label:hover {
	border-color: #0073aa;
	background: #f4faff;
}

.at-radio-label input[type="radio"] {
	width: auto;
	margin: 0;
}

.at-radio-label input[type="radio"]:checked + span,
.at-radio-label:has(input:checked) {
	border-color: #0073aa;
	background: #e8f4fb;
}

/* Required marker */
.at-required {
	color: #dc3232;
}

/* Submit */
.at-form-submit {
	text-align: center;
	margin-top: 1.5em;
}

.at-btn {
	display: inline-block;
	padding: .75em 2.5em;
	border: none;
	border-radius: 4px;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s;
}

.at-btn-primary {
	background: #0073aa;
	color: #fff;
}

.at-btn-primary:hover {
	background: #005f8d;
}

/* Checkbox privacy */
.at-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: .6em;
	cursor: pointer;
	font-weight: normal;
	line-height: 1.5;
}

.at-checkbox-label input[type="checkbox"] {
	width: auto;
	margin-top: .2em;
	flex-shrink: 0;
}

/* Firma canvas */
.at-signature-wrap {
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	display: inline-block;
	width: 100%;
}

.at-signature-canvas {
	display: block;
	width: 100%;
	height: 150px;
	cursor: crosshair;
	touch-action: none;
	border-bottom: 1px dashed #ddd;
}

.at-signature-actions {
	padding: .4em .6em;
	text-align: right;
}

.at-btn-secondary {
	background: #f0f0f0;
	color: #333;
	border: 1px solid #ccc;
	font-size: .85em;
	padding: .35em 1em;
}

.at-btn-secondary:hover {
	background: #e0e0e0;
}

.at-signature-wrap.at-field-error {
	border-color: #dc3232;
	box-shadow: 0 0 0 2px rgba(220, 50, 50, .15);
}

/* Responsive */
@media (max-width: 600px) {
	.at-row-2 .at-field,
	.at-row-3 .at-field {
		flex: 1 1 100%;
	}

	.at-field-small {
		flex: 1 1 100%;
	}
}
