/* AM Quiz - stile frontend (Typeform-like) */

.amq-form {
	--amq-accent: #2563eb;
	--amq-text: #1f2937;
	--amq-muted: #6b7280;
	position: relative;
	background: #fff;
	color: var(--amq-text);
	font-family: inherit;
	overflow: hidden;
}

/* Inline: altezza contenuta. Popup: fullscreen. */
.amq-inline .amq-form {
	min-height: 560px;
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .08);
}

/* ---- Progress bar ---- */
.amq-progress {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 5px;
	background: rgba(0, 0, 0, .06);
	z-index: 5;
}
.amq-progress-bar {
	display: block;
	height: 100%;
	width: 0;
	background: var(--amq-accent);
	transition: width .4s ease;
}

/* ---- Slides ---- */
.amq-slides {
	position: relative;
	min-height: inherit;
	flex: 1 1 auto;
}
.amq-slide {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;        /* centratura verticale */
	justify-content: center;    /* centratura orizzontale */
	padding: 48px 32px;
	opacity: 0;
	transform: translateY(28px);
	transition: opacity .45s ease, transform .45s ease;
}
.amq-slide.is-active {
	display: flex;
	opacity: 1;
	transform: translateY(0);
}
.amq-slide.is-leaving {
	opacity: 0;
	transform: translateY(-28px);
}
.amq-slide-inner {
	width: 100%;
	max-width: 620px;
	margin: 0 auto;
}

/* ---- Logo schermata iniziale ---- */
.amq-welcome-logo {
	display: block;
	max-width: 250px;
	width: auto;
	height: auto;
	margin: 0 0 24px;
}
.amq-slide-welcome { text-align: left; }

/* ---- Titoli ---- */
.amq-q-title {
	font-size: clamp(22px, 3.2vw, 34px);
	line-height: 1.25;
	font-weight: 700;
	margin: 0 0 10px;
	color: var(--amq-text);
}
.amq-req { color: var(--amq-accent); }
.amq-q-desc {
	font-size: 17px;
	color: var(--amq-muted);
	margin: 0 0 26px;
}
.amq-q-input { margin: 22px 0 8px; }

/* ---- Input testo ---- */
.amq-input {
	width: 100%;
	border: none;
	border-bottom: 2px solid rgba(0, 0, 0, .18);
	background: transparent;
	font-size: 24px;
	padding: 10px 2px;
	color: var(--amq-text);
	outline: none;
	transition: border-color .2s;
	box-sizing: border-box;
}
.amq-input:focus { border-color: var(--amq-accent); }
.amq-textarea { resize: vertical; min-height: 90px; }
textarea.amq-input.amq-textarea {
	padding: 20px;
	font-size: 18px;
	border: 2px solid rgba(0, 0, 0, .18);
	border-radius: 10px;
}
textarea.amq-input.amq-textarea:focus { border-color: var(--amq-accent); }
.amq-select {
	border: 2px solid rgba(0, 0, 0, .18);
	border-radius: 10px;
	padding: 14px;
	font-size: 18px;
}

/* ---- Scelte (radio/checkbox stile bottone) ---- */
.amq-choices { display: flex; flex-direction: column; gap: 12px; }
.amq-choice {
	display: flex;
	align-items: center;
	gap: 12px;
	border: 2px solid rgba(0, 0, 0, .14);
	border-radius: 10px;
	padding: 14px 16px;
	font-size: 18px;
	cursor: pointer;
	transition: all .15s;
	background: #fff;
}
.amq-choice:hover { border-color: var(--amq-accent); background: rgba(37, 99, 235, .04); }
.amq-choice input { display: none; }
.amq-choice.is-selected {
	border-color: var(--amq-accent);
	background: color-mix(in srgb, var(--amq-accent) 10%, #fff);
}
.amq-key {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 1px solid rgba(0, 0, 0, .25);
	border-radius: 6px;
	font-size: 13px;
	font-weight: 700;
	color: var(--amq-muted);
	flex: none;
}
.amq-choice.is-selected .amq-key {
	background: var(--amq-accent);
	border-color: var(--amq-accent);
	color: #fff;
}

/* ---- Campo "Altro" ---- */
.amq-other-input {
	width: 100%;
	margin-top: 12px;
	border: 2px solid var(--amq-accent);
	border-radius: 10px;
	padding: 14px 16px;
	font-size: 18px;
	outline: none;
	box-sizing: border-box;
}

/* ---- Rating a stelle ---- */
.amq-rating { display: flex; gap: 8px; }
.amq-star {
	background: none !important;
	border: none !important;
	border-radius: 0 !important;
	font-size: 40px;
	line-height: 1;
	color: rgba(0, 0, 0, .18) !important;
	cursor: pointer;
	transition: color .15s, transform .1s;
	padding: 0 !important;
}
.amq-star:hover { transform: scale(1.1); }
.amq-star.is-on { color: var(--amq-accent) !important; }

/* ---- Scala numerica ---- */
.amq-scale { display: flex; flex-wrap: wrap; gap: 8px; }
.amq-scale-item input { display: none; }
.amq-scale-item span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border: 2px solid rgba(0, 0, 0, .14);
	border-radius: 10px;
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	transition: all .15s;
}
.amq-scale-item:hover span { border-color: var(--amq-accent); }
.amq-scale-item.is-selected span {
	background: var(--amq-accent);
	border-color: var(--amq-accent);
	color: #fff;
}

/* ---- Reset contro il kit del tema/Elementor (gradiente, pill, bordi) ---- */
.amq-form button,
.amq-trigger {
	-webkit-appearance: none;
	appearance: none;
	background-image: none !important;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	line-height: 1.2 !important;
	font-family: inherit;
}

/* ---- Azioni / pulsanti ---- */
.amq-actions { margin-top: 28px; }
.amq-btn {
	background: var(--amq-accent) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 10px !important;
	padding: 15px 30px !important;
	font-size: 17px;
	font-weight: 600;
	cursor: pointer;
	transition: filter .15s, transform .1s;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: auto !important;
}
.amq-btn:hover { filter: brightness(.93); }
.amq-btn:active { transform: scale(.98); }
.amq-btn[disabled] { opacity: .5; cursor: not-allowed; }
.amq-enter { font-size: 13px; opacity: .8; }

/* ---- Errore ---- */
.amq-error {
	color: #dc2626;
	font-size: 15px;
	margin-top: 12px;
}

/* ---- Schermata finale ---- */
.amq-slide-thankyou { text-align: center; }
.amq-check {
	width: 72px;
	height: 72px;
	margin: 0 auto 18px;
	border-radius: 50%;
	background: var(--amq-accent);
	color: #fff;
	font-size: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ---- Navigazione su/giù ---- */
.amq-nav {
	position: absolute;
	right: 18px;
	bottom: 18px;
	display: flex;
	gap: 2px;
	z-index: 5;
}
.amq-nav-btn {
	width: 42px;
	height: 40px;
	border: none !important;
	background: var(--amq-accent) !important;
	color: #fff !important;
	cursor: pointer;
	font-size: 16px;
}
.amq-nav-btn:first-child { border-radius: 8px 0 0 8px !important; }
.amq-nav-btn:last-child { border-radius: 0 8px 8px 0 !important; }
.amq-nav-btn[disabled] { opacity: .4; cursor: default; }

/* ---- Pulsante trigger del popup ---- */
.amq-trigger {
	background: var(--amq-accent, #2563eb) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 10px !important;
	padding: 15px 30px !important;
	font-size: 17px;
	font-weight: 600;
	cursor: pointer;
}
.amq-trigger:hover { filter: brightness(.93); }

/* ---- Overlay popup ---- */
.amq-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, .55);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	opacity: 0;
	transition: opacity .25s;
}
/* Quando chiuso non deve esistere a schermo (altrimenti blocca i click). */
.amq-overlay[hidden] { display: none !important; }
.amq-overlay.is-open { opacity: 1; }
.amq-overlay-inner {
	position: relative;
	background: #fff;
	width: 100%;
	height: 100%;
	max-width: 100%;
	overflow: auto;
}
.amq-overlay-inner .amq-form { min-height: 100vh; }
.amq-close {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 10;
	background: rgba(0, 0, 0, .06) !important;
	background-image: none !important;
	border: none !important;
	border-radius: 50% !important;
	width: 44px;
	height: 44px;
	padding: 0 !important;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #111 !important;
	display: flex;
	align-items: center;
	justify-content: center;
}
.amq-close:hover { background: rgba(0, 0, 0, .12) !important; }

body.amq-noscroll { overflow: hidden; }

@media (max-width: 600px) {
	.amq-slide { padding: 40px 20px; }
	.amq-input { font-size: 20px; }
}
