/**
 * ASC Prenotazioni Esami — stili frontend.
 * Le variabili in :root del blocco permettono al tema di ritoccare
 * i colori senza riscrivere i selettori.
 */

.asc-form {
	--asc-accent: #009EE0;
	--asc-accent-dark: #05628B;
	--asc-dark: #1F2A56;
	--asc-border: #E2E6EC;
	--asc-bg-soft: #F7F9FB;
	--asc-text: #2B2F38;
	--asc-muted: #6B7280;
	--asc-error: #D93025;

	/*
	 * Derivate dal colore accento. Sono variabili perché lo shortcode
	 * le ricalcola quando la palette viene sovrascritta: altrimenti
	 * focus, ombre e sfondi resterebbero azzurri su un modulo viola.
	 */
	--asc-accent-soft: rgba(0, 158, 224, .18);
	--asc-accent-ring: rgba(0, 158, 224, .32);
	--asc-accent-glow: rgba(0, 158, 224, .14);
	--asc-accent-tint: rgba(0, 158, 224, .10);
	--asc-dark-hover: #16203F;
	--asc-radius: 10px;

	max-width: 820px;
	color: var(--asc-text);
}

.asc-form *,
.asc-form *::before,
.asc-form *::after {
	box-sizing: border-box;
}

/* ---------- Intestazione ---------- */
.asc-form__eyebrow {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--asc-text);
}

.asc-form__title {
	font-size: 42px;
	line-height: 1.1;
	margin: 8px 0 30px;
	color: var(--asc-dark);
}

.asc-form__title span {
	color: var(--asc-accent);
}

/* ---------- Sezioni ---------- */
.asc-fieldset {
	border: 0;
	padding: 0;
	margin: 0 0 30px;
	min-width: 0;
}

.asc-legend {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0;
	margin-bottom: 6px;
	font-size: 18px;
	font-weight: 700;
	color: var(--asc-dark);
}

.asc-step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--asc-accent);
	color: #fff;
	font-size: 14px;
	line-height: 1;
}

.asc-hint {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--asc-muted);
}

.asc-optional {
	font-size: 14px;
	font-weight: 400;
	color: var(--asc-muted);
}

/* ---------- Schede esame ---------- */
.asc-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.asc-card {
	position: relative;
	display: flex;
}

.asc-card__input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	margin: 0;
}

.asc-card__label {
	display: block;
	width: 100%;
	padding: 18px 18px 18px 48px;
	border: 1.5px solid var(--asc-border);
	border-radius: var(--asc-radius);
	background: var(--asc-bg-soft);
	cursor: pointer;
	transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.asc-card__label::before {
	content: "";
	position: absolute;
	left: 18px;
	top: 20px;
	width: 20px;
	height: 20px;
	border: 1.5px solid #C3CBD6;
	border-radius: 5px;
	background: #fff;
	transition: background .18s ease, border-color .18s ease;
}

.asc-card__label::after {
	content: "";
	position: absolute;
	left: 25px;
	top: 24px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0);
	transition: transform .18s ease;
}

.asc-card__label:hover {
	border-color: var(--asc-accent);
	background: #fff;
}

.asc-card__input:checked + .asc-card__label {
	border-color: var(--asc-accent);
	background: #fff;
	box-shadow: 0 2px 14px var(--asc-accent-glow);
}

.asc-card__input:checked + .asc-card__label::before {
	background: var(--asc-accent);
	border-color: var(--asc-accent);
}

.asc-card__input:checked + .asc-card__label::after {
	transform: rotate(45deg) scale(1);
}

.asc-card__input:focus-visible + .asc-card__label {
	outline: none;
	box-shadow: 0 0 0 3px var(--asc-accent-ring);
}

.asc-card__name {
	display: block;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--asc-dark);
}

.asc-card__subtitle {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	font-weight: 600;
	color: var(--asc-accent-dark);
}

.asc-card__desc {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--asc-muted);
}

/* ---------- Scheda bloccata (esame della pagina) ---------- */
.asc-card--locked .asc-card__label {
	border-color: var(--asc-accent);
	background: #fff;
	cursor: default;
	box-shadow: 0 2px 14px var(--asc-accent-glow);
}

.asc-card--locked .asc-card__label:hover {
	background: #fff;
}

/* Spunta piena e non interattiva: comunica "è già dentro". */
.asc-card--locked .asc-card__label::before {
	background: var(--asc-accent);
	border-color: var(--asc-accent);
}

.asc-card--locked .asc-card__label::after {
	transform: rotate(45deg) scale(1);
}

.asc-card__badge {
	display: inline-block;
	margin-top: 10px;
	padding: 4px 11px;
	border-radius: 12px;
	background: var(--asc-accent-tint);
	color: var(--asc-accent-dark);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
}

/* ---------- Campi ---------- */
.asc-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.asc-field {
	margin: 0;
	min-width: 0;
}

.asc-field--full {
	grid-column: 1 / -1;
}

.asc-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--asc-dark);
}

.asc-field abbr {
	color: var(--asc-accent);
	text-decoration: none;
	border: 0;
}

.asc-form input[type="text"],
.asc-form input[type="tel"],
.asc-form input[type="email"],
.asc-form select,
.asc-form textarea {
	width: 100%;
	padding: 13px 15px;
	border: 1px solid var(--asc-border);
	border-radius: 8px;
	background: #fff;
	font-family: inherit;
	font-size: 16px;
	color: var(--asc-text);
	transition: border-color .18s ease, box-shadow .18s ease;
}

.asc-form input:focus,
.asc-form select:focus,
.asc-form textarea:focus {
	outline: none;
	border-color: var(--asc-accent);
	box-shadow: 0 0 0 3px var(--asc-accent-soft);
}

.asc-form textarea {
	min-height: 118px;
	resize: vertical;
}

.asc-form .is-invalid {
	border-color: var(--asc-error);
}

.asc-error {
	display: none;
	margin: 6px 0 0;
	font-size: 13px;
	line-height: 1.4;
	color: var(--asc-error);
}

.asc-error.is-visible {
	display: block;
}

/* ---------- Blocco condizionale ---------- */
.asc-conditional[hidden] {
	display: none;
}

.asc-conditional {
	padding: 22px;
	border: 1px solid var(--asc-border);
	border-left: 4px solid var(--asc-accent);
	border-radius: var(--asc-radius);
	background: var(--asc-bg-soft);
	animation: asc-reveal .25s ease;
}

@keyframes asc-reveal {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: none; }
}

/* ---------- Privacy ---------- */
.asc-privacy {
	padding: 18px;
	margin-bottom: 24px;
	border-radius: var(--asc-radius);
	background: var(--asc-bg-soft);
}

.asc-privacy label {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	cursor: pointer;
	font-size: 12.5px;
	line-height: 1.55;
	color: var(--asc-muted);
}

.asc-privacy input[type="checkbox"] {
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--asc-accent);
}

.asc-privacy a {
	color: var(--asc-accent);
	text-decoration: underline;
	white-space: nowrap;
}

/* ---------- Submit ---------- */
.asc-submit {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
}

.asc-button {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	padding: 16px 36px;
	border: 0;
	border-radius: 8px;
	background: var(--asc-dark);
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background .18s ease, transform .12s ease, opacity .18s ease;
}

.asc-button:hover {
	background: var(--asc-dark-hover);
}

.asc-button:active {
	transform: translateY(1px);
}

.asc-button:focus-visible {
	outline: 3px solid var(--asc-accent-ring);
	outline-offset: 2px;
}

.asc-button[disabled] {
	opacity: .6;
	cursor: progress;
}

.asc-button__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--asc-accent);
}

.asc-reassure {
	margin: 0;
	font-size: 13px;
	color: var(--asc-muted);
}

/* ---------- Messaggi di esito ---------- */
.asc-alert,
.asc-response:not(:empty) {
	padding: 15px 18px;
	margin: 20px 0 0;
	border-radius: 8px;
	font-size: 14.5px;
	line-height: 1.55;
}

.asc-alert {
	margin: 0 0 24px;
}

.asc-alert--success,
.asc-response.is-success {
	background: #E7F6EC;
	border-left: 4px solid #1E8E3E;
	color: #14602A;
}

.asc-alert--error,
.asc-response.is-error {
	background: #FDECEA;
	border-left: 4px solid var(--asc-error);
	color: #A0221A;
}

/* ---------- Honeypot ---------- */
.asc-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Accessibilità ---------- */
.asc-form .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.asc-conditional { animation: none; }
	.asc-form *,
	.asc-form *::before,
	.asc-form *::after { transition: none !important; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
	.asc-form__title { font-size: 32px; }
	.asc-cards { grid-template-columns: 1fr; }
	.asc-grid { grid-template-columns: 1fr; }
	.asc-button { width: 100%; justify-content: center; }
}
