/* Digital Check (full screen) and result page. */

/* Check layout ------------------------------------------------------------ */

.page-check { min-height: 100vh; min-height: 100dvh; }

.check {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.check__bar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 56px;
	padding-inline: var(--gutter);
}
.check__bar .logo__svg { height: 24px; }
.check__exit { font-weight: 600; font-size: 1rem; padding: 10px 0; }
.check__progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--c-line);
}
.check__progress span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--c-accent);
	transition: width .35s var(--ease);
}

.check__layout {
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* Mobile budget (≈390×750 visible on iPhone): bar 56 + stage ≤ 18vh + question + 4 options ≥ 56px
   + fixed Back bar 64. All four answers must fit without scrolling, D1 included. */
.check__stage {
	height: 18vh;
	padding: 8px var(--gutter) 0;
	display: flex;
	justify-content: center;
}
.check__stage .blocks { height: 100%; width: auto; overflow: visible; }
/* Short phones (e.g. 375×667): no room for the stage, the question comes first. */
@media (max-width: 1023px) and (max-height: 699px) {
	.check__stage { display: none; }
}

.check__main {
	flex: 1;
	position: relative;
	padding: 12px var(--gutter) calc(80px + env(safe-area-inset-bottom));
	overflow: hidden;
}

.check__intro .lead { margin-top: 20px; }
.check__points { margin: 24px 0 32px; display: grid; gap: 10px; }
.check__points li { position: relative; padding-left: 24px; }
.check__points li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 10px;
	height: 10px;
	background: var(--c-accent);
}

/* Mobile: Back fixed at the bottom. */
.check__nav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 64px;
	padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
	background: var(--c-bg);
	border-top: 1px solid var(--c-line);
}
.check__back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 4px;
	border: 0;
	background: none;
	font-weight: 600;
}
.check__back[disabled] { visibility: hidden; }
.check__count { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--c-ink-2); }

@media (min-width: 1024px) {
	.check__layout {
		display: grid;
		grid-template-columns: repeat(12, 1fr);
		column-gap: var(--gutter);
		max-width: var(--maxw);
		width: 100%;
		margin-inline: auto;
		padding-inline: var(--gutter);
	}
	.check__main { grid-column: 1 / span 7; grid-row: 1; padding: 8vh 0 140px; align-self: start; }
	.check__stage .blocks { max-height: 70vh; }
	.check__stage { grid-column: 8 / span 5; grid-row: 1; height: calc(100vh - 140px); padding: 6vh 0 0; position: sticky; top: 0; }
	.check__nav {
		position: fixed;
		left: 50%;
		transform: translateX(-50%);
		width: 100%;
		max-width: var(--maxw);
		border-top: 0;
		background: transparent;
		pointer-events: none;
	}
	.check__nav > * { pointer-events: auto; }
	.check__nav { justify-content: flex-start; gap: 32px; }
}

/* Question ---------------------------------------------------------------- */

.q { will-change: transform, opacity; }
.q__area {
	font-size: var(--fs-small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.q__intro { margin-top: 2px; color: var(--c-ink-2); font-size: 0.9375rem; line-height: 1.35; }
.q__title {
	margin-top: 10px;
	/* Mobile: 1.5–1.75rem so long questions (D1) leave room for the four answers. */
	font-size: clamp(1.5rem, 6.4vw, 1.75rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.08;
	text-wrap: balance;
}
.q__title:focus { outline: none; }
.q__options {
	display: grid;
	margin-top: 18px;
	border-top: 1px solid var(--c-line);
}
.opt {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-height: 56px;
	padding: 8px 12px 8px 0;
	border: 0;
	border-bottom: 1px solid var(--c-line);
	background: none;
	text-align: left;
	font-size: 1.0625rem;
	line-height: 1.3;
	transition: background-color .15s var(--ease), color .15s var(--ease), padding .2s var(--ease);
}
.opt__key {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border: 1px solid currentColor;
	border-radius: var(--radius);
	font-size: var(--fs-small);
	font-weight: 600;
	text-transform: uppercase;
}
.opt:hover { padding-left: 12px; background: var(--c-surface); }
.opt:hover .opt__key { background: var(--c-accent); border-color: var(--c-accent); }
.opt.is-selected, .opt[aria-pressed="true"] {
	padding-left: 12px;
	background: var(--c-ink);
	color: #fff;
}
.opt.is-selected .opt__key, .opt[aria-pressed="true"] .opt__key { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-ink); }
.opt:focus-visible { outline-offset: -3px; }

@media (min-width: 768px) {
	.q__intro { margin-top: 6px; font-size: 1rem; }
	.q__title { margin-top: 16px; font-size: var(--fs-q); letter-spacing: -0.035em; line-height: 1.02; max-width: 20ch; }
	.q__options { margin-top: 28px; }
	.opt { gap: 16px; min-height: 64px; padding: 14px 12px 14px 0; }
	.opt__key { width: 32px; height: 32px; }
}

/* Transition: old question leaves upward, new one enters from below (350 ms). */
.q.is-leaving { animation: q-out .35s var(--ease) forwards; }
.q.is-entering { animation: q-in .35s var(--ease) both; }
.q.is-leaving-back { animation: q-out-back .35s var(--ease) forwards; }
.q.is-entering-back { animation: q-in-back .35s var(--ease) both; }
@keyframes q-out { to { opacity: 0; transform: translateY(-48px); } }
@keyframes q-in { from { opacity: 0; transform: translateY(48px); } }
@keyframes q-out-back { to { opacity: 0; transform: translateY(48px); } }
@keyframes q-in-back { from { opacity: 0; transform: translateY(-48px); } }

.check__status { padding-top: 8vh; }
.check__loading { font-size: var(--fs-h3); font-weight: 700; }
.check__status .btn { margin-top: 24px; }

/* Stage reactions --------------------------------------------------------- */

.blocks--stage .blk {
	transform-box: fill-box;
	transform-origin: 50% 100%;
	opacity: 0;
	transform: translate(var(--tx, 0px), -60px) rotate(var(--r, 0deg));
	transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.blocks--stage .blk.is-in {
	opacity: 1;
	transform: translate(var(--tx, 0px), 0) rotate(var(--r, 0deg));
}
/* C2 shows the base slab as an outline, widened by company size; Strategia fills it. */
.blocks--stage .blk[data-area="strategia"].is-base { opacity: 1; transform: scaleX(var(--w, .7)); }
.blocks--stage .blk[data-area="strategia"].is-base .t-ink { fill: #fff; stroke: var(--c-ink); stroke-width: 1.5; }
.blocks--stage .blk[data-area="strategia"].is-base.is-in { transform: translate(var(--tx, 0px), 0) rotate(var(--r, 0deg)) scaleX(var(--w, 1)); }
.blocks--stage .blk[data-area="strategia"].is-base.is-in .t-ink { fill: var(--c-ink); stroke: #fff; stroke-width: 1; }

@media (prefers-reduced-motion: reduce) {
	.q.is-leaving, .q.is-entering, .q.is-leaving-back, .q.is-entering-back { animation: none; }
	.blocks--stage .blk { transition: none; }
}

/* Result ------------------------------------------------------------------ */

.result__score { padding-block: clamp(40px, 8vw, 120px) clamp(32px, 5vw, 64px); }
.score {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 16px;
	margin-top: 12px;
}
.score__n {
	font-size: var(--fs-display);
	font-weight: 800;
	letter-spacing: -0.05em;
	line-height: 0.9;
}
.score__max { font-size: var(--fs-h3); color: var(--c-ink-2); font-weight: 600; margin-left: -8px; }
.score__band {
	align-self: center;
	padding: 6px 12px;
	background: var(--c-accent);
	color: var(--c-accent-ink);
	font-size: var(--fs-small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	border-radius: var(--radius);
}
.result__score .lead { margin-top: 24px; }
.result__score .note { margin-top: 12px; }

.result__profile .h2 { max-width: 16ch; }
.diagnosis {
	margin-top: 28px;
	font-size: 1.375rem;
	line-height: 1.45;
	max-width: 58ch;
}

.chart {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 8px;
	align-items: end;
	max-width: 880px;
}
.chart__item { display: grid; justify-items: center; gap: 6px; text-align: center; }
.chart-col { width: 100%; max-width: 132px; height: auto; overflow: visible; }
.chart__label { font-size: 0.8125rem; font-weight: 600; }
.chart__score { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
@media (min-width: 768px) {
	.chart { gap: var(--gutter); }
	.chart__label { font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.08em; }
}

/* Path: vertical on mobile, horizontal rail from 768px. */
.rail { position: relative; display: grid; gap: 28px; }
.rail::before {
	content: "";
	position: absolute;
	left: 11px;
	top: 12px;
	bottom: 12px;
	width: 2px;
	background: var(--c-ink);
}
.rail__stop { position: relative; display: grid; gap: 2px; padding-left: 44px; }
.rail__dot {
	position: absolute;
	left: 0;
	top: 2px;
	width: 24px;
	height: 24px;
	border: 2px solid var(--c-ink);
	border-radius: 50%;
	background: #fff;
}
.rail__stop.is-active .rail__dot { background: var(--c-ink); }
.rail__stop.is-start .rail__dot { box-shadow: 0 0 0 5px #fff, 0 0 0 9px var(--c-accent); }
.rail__label { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.rail__stop:not(.is-active) .rail__label { color: var(--c-ink-2); }
.rail__text { color: var(--c-ink-2); max-width: 28ch; }
.rail__start { margin-top: 40px; font-size: var(--fs-lead); font-weight: 600; }

@media (min-width: 768px) {
	.rail { grid-template-columns: repeat(4, 1fr); gap: var(--gutter); }
	.rail::before { left: 12px; right: 12px; top: 11px; bottom: auto; width: auto; height: 2px; }
	.rail__stop { padding-left: 0; padding-top: 48px; }
}

.tips { border-top: 1px solid var(--c-line); }
.tip {
	display: grid;
	grid-template-columns: 56px 1fr;
	gap: 16px;
	padding: 28px 0;
	border-bottom: 1px solid var(--c-line);
}
.tip__n { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.04em; line-height: 0.9; color: var(--c-accent); }
.tip p { font-size: 1.1875rem; max-width: 60ch; }
@media (min-width: 768px) {
	.tip { grid-template-columns: 120px 1fr; }
	.tip p { font-size: var(--fs-lead); line-height: 1.4; }
}

/* Gate: inverted section, form on a white card. */
.gate__title { max-width: 14ch; }
.gate__lead { margin: 24px 0 40px; color: #fff; }
.result__gate .form-card { max-width: 720px; }

.contact-block { border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); padding: 8px 0; }
.contact-block__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: 56px;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	text-align: left;
}
.contact-block__icon::before { content: "+"; font-weight: 400; }
.contact-block.is-open .contact-block__icon::before { content: "–"; }
.contact-block__body { display: grid; gap: 24px; padding-bottom: 24px; }
.contact-fields { display: grid; gap: 24px; }

.after-lead:focus { outline: none; }
.confirm .lead { max-width: 46ch; color: #fff; }
.confirm .link-arrow { color: #fff; margin-top: 8px; }
.recontact { margin-top: 24px; max-width: 720px; }

.plan { margin-top: clamp(48px, 8vw, 96px); }
.plan__title { max-width: 12ch; margin-bottom: 48px; }
.plan__phases { display: grid; gap: 16px; }
.phase { background: #fff; color: var(--c-ink); padding: 24px; border-radius: var(--radius); }
.phase__n { display: block; font-size: var(--fs-h2); font-weight: 800; color: var(--c-accent); line-height: 1; letter-spacing: -0.04em; }
.phase__title { margin: 12px 0 16px; font-size: 1.125rem; font-weight: 700; }
.phase__actions { display: grid; gap: 12px; }
.phase__actions li { padding-top: 12px; border-top: 1px solid var(--c-line); }
.plan__after { margin-top: 32px; font-size: var(--fs-lead); }
.plan__note { margin-top: 12px; }
@media (min-width: 900px) {
	.plan__phases { grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
}

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.share__done { font-weight: 600; }
