/*
 * Il colore principale si può cambiare dal tema (Aspetto → Personalizza → CSS aggiuntivo):
 * .ypsq-study { --ypsq-accent: #0a7c66; }
 */
.ypsq-study {
	--ypsq-accent: #2f5bea;
	--ypsq-accent-dark: #1f44c2;
	--ypsq-text: #1c2230;
	--ypsq-muted: #5d6677;
	--ypsq-border: #e3e6ec;
	--ypsq-soft: #f4f6fa;

	width: 100%;
	max-width: 100%;
	margin: 0;
	color: var(--ypsq-text);
	font-size: 17px;
	line-height: 1.6;
	box-sizing: border-box;
}

/* I temi a blocchi limitano i figli diretti del contenuto alla "content width". */
.is-layout-constrained > .ypsq-study:not([style]),
.entry-content > .ypsq-study:not([style]) {
	max-width: 100%;
}

.ypsq-study *,
.ypsq-study *::before,
.ypsq-study *::after {
	box-sizing: border-box;
}

.ypsq-study p {
	margin: 0 0 12px;
}

/* ---------- Card ---------- */

.ypsq-study .ypsq-card {
	margin: 0 0 24px;
	padding: 40px;
	background: #fff;
	border: 1px solid var(--ypsq-border);
	border-radius: 14px;
	box-shadow: 0 6px 24px rgba(28, 34, 48, 0.06);
}

.ypsq-study .ypsq-eyebrow {
	margin: 0 0 6px;
	color: var(--ypsq-accent);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ypsq-study .ypsq-title {
	margin: 0 0 16px;
	color: var(--ypsq-text);
	font-size: 30px;
	line-height: 1.2;
}

/* ---------- Benvenuto ---------- */

.ypsq-study .ypsq-intro {
	color: var(--ypsq-muted);
}

.ypsq-study .ypsq-facts {
	margin: 24px 0 32px;
	padding: 0;
	list-style: none;
}

.ypsq-study .ypsq-facts li {
	position: relative;
	margin: 0 0 10px;
	padding-left: 28px;
}

.ypsq-study .ypsq-facts li::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 0.55em;
	width: 10px;
	height: 10px;
	background: var(--ypsq-accent);
	border-radius: 50%;
	opacity: 0.85;
}

/* ---------- Pulsante ---------- */

.ypsq-study .ypsq-button {
	display: inline-block;
	margin: 0;
	padding: 15px 30px;
	font: inherit;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	color: #fff;
	background: var(--ypsq-accent);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	text-decoration: none;
	white-space: normal;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.ypsq-study .ypsq-button:hover,
.ypsq-study .ypsq-button:focus {
	color: #fff;
	background: var(--ypsq-accent-dark);
}

.ypsq-study .ypsq-button:focus-visible {
	outline: 3px solid var(--ypsq-accent);
	outline-offset: 3px;
}

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

.ypsq-study .ypsq-button[disabled] {
	opacity: 0.6;
	cursor: wait;
}

/* ---------- Questionario ---------- */

.ypsq-study .ypsq-header {
	margin-bottom: 16px;
}

.ypsq-study .ypsq-progress {
	display: flex;
	gap: 6px;
	margin: 8px 0 14px;
}

.ypsq-study .ypsq-segment {
	flex: 1;
	height: 6px;
	background: var(--ypsq-border);
	border-radius: 999px;
}

.ypsq-study .ypsq-segment.is-done {
	background: var(--ypsq-accent);
}

.ypsq-study .ypsq-segment.is-current {
	background: var(--ypsq-accent);
	opacity: 0.4;
}

.ypsq-study .ypsq-hint {
	color: var(--ypsq-muted);
}

.ypsq-study .ypsq-frame-wrap {
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--ypsq-border);
	border-radius: 14px;
}

.ypsq-study .ypsq-frame {
	display: block;
	width: 100%;
	height: 750px;
	border: 0;
	background: #fff;
}

.ypsq-study .ypsq-fallback {
	margin-top: 10px;
	color: var(--ypsq-muted);
	font-size: 14px;
}

.ypsq-study .ypsq-fallback a {
	color: var(--ypsq-accent);
}

.ypsq-study .ypsq-confirm {
	margin-top: 24px;
	padding: 28px;
	text-align: center;
	background: var(--ypsq-soft);
	box-shadow: none;
}

.ypsq-study .ypsq-confirm-title {
	margin-bottom: 18px;
	font-weight: 600;
}

/* ---------- Fine ---------- */

.ypsq-study .ypsq-done {
	text-align: center;
}

.ypsq-study .ypsq-done > p {
	max-width: 560px;
	margin-left: auto;
	margin-right: auto;
}

.ypsq-study .ypsq-check {
	display: block;
	width: 64px;
	height: 64px;
	margin: 0 auto 20px;
	padding: 14px;
	background: var(--ypsq-soft);
	border-radius: 50%;
	fill: none;
	stroke: var(--ypsq-accent);
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ypsq-study .ypsq-code-box {
	margin: 28px auto 16px;
	padding: 18px 24px;
	background: var(--ypsq-soft);
	border: 1px dashed var(--ypsq-border);
	border-radius: 12px;
}

.ypsq-study .ypsq-code-label {
	margin: 0 0 4px;
	color: var(--ypsq-muted);
	font-size: 14px;
}

.ypsq-study .ypsq-code {
	margin: 0;
	font-family: Consolas, Monaco, monospace;
	font-size: 28px;
	font-weight: 700;
	letter-spacing: 0.12em;
	user-select: all;
}

.ypsq-study .ypsq-note {
	color: var(--ypsq-muted);
	font-size: 15px;
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
	.ypsq-study .ypsq-card {
		padding: 24px 20px;
	}

	.ypsq-study .ypsq-title {
		font-size: 24px;
	}

	.ypsq-study .ypsq-button {
		width: 100%;
	}

	.ypsq-study .ypsq-frame {
		height: 80vh;
	}
}
