/* ==========================================================================
   Passo a passo (página "Como participar"). Carregado só no modelo "Passo a passo".
   1. Carrossel horizontal  2. Passo (cartão)  3. Progresso  4. Celular/tablet  5. Chamada final
   A seção de vídeo do topo usa o CSS compartilhado (components.css → .s-video).
   ========================================================================== */

/* ==========================================================================
   1. CARROSSEL HORIZONTAL (desktop ≥ 1024px)
   A seção ganha altura = largura do trilho (views/passo-a-passo.js). O bloco de dentro fica
   preso na tela (sticky) e o trilho anda para o lado conforme a rolagem.
   ========================================================================== */
.p-steps {
	position: relative;
	border-top: 1px solid var(--lpt-line);
	background: linear-gradient(180deg, var(--lpt-ink-wash), var(--lpt-night-wash) 60%, var(--lpt-ink-wash));
}
.p-steps__sticky {
	position: sticky;
	top: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	height: 100vh;
	height: 100svh;
	overflow: hidden;
	overflow: clip;                        /* clip: o navegador não consegue rolar este bloco ao focar um link */
	padding-top: var(--lpt-header-h);
}
.p-steps__track {
	--start: max(var(--lpt-gutter), calc((100vw - var(--lpt-container)) / 2));
	display: flex;
	align-items: center;
	gap: clamp(3rem, 6vw, 6rem);
	width: max-content;
	padding-inline: var(--start) var(--lpt-gutter);
	will-change: transform;
}

/* Painel de introdução (o primeiro do trilho) */
.p-steps__intro {
	flex: 0 0 auto;
	width: min(32rem, 36vw);
}
.p-steps__title {
	font-size: var(--lpt-fs-h2);
}
.p-steps__text {
	max-width: 44ch;
	margin-top: var(--lpt-space-5);
	color: var(--lpt-text-muted);
	font-size: var(--lpt-fs-lead);
}
.p-steps__actions {
	align-items: center;
}
.p-steps__hint {
	display: inline-flex;
	align-items: center;
	gap: var(--lpt-space-2);
	margin-top: var(--lpt-space-8);
	color: var(--lpt-text-subtle);
	font-size: var(--lpt-fs-xs);
}
.p-steps__hint svg {
	width: 18px;
	height: 18px;
	color: var(--lpt-accent-text);
}
.p-steps__hint-touch {
	display: none;
}

.p-steps__list {
	display: flex;
	gap: clamp(2rem, 4vw, 4rem);
	margin: 0;
}

/* ==========================================================================
   2. PASSO (cartão): print em cima; número + título + texto embaixo
   ========================================================================== */
.p-step {
	position: relative;                    /* prende o texto para leitores de tela dentro do cartão (sem vazar do carrossel) */
	flex: 0 0 auto;
	width: min(52vw, 46rem);
}
.p-step__media {
	position: relative;
	overflow: hidden;
	margin: 0;
	aspect-ratio: 1440 / 789;
	border: 1px solid var(--lpt-frame);
	border-radius: var(--lpt-radius-lg);
	background: var(--lpt-surface);
	box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .9);
}
.p-step__media picture,
.p-step__img {
	display: block;
	width: 100%;
	height: 100%;
}
.p-step__img {
	object-fit: cover;
	object-position: top center;
}

/* Capturas do guia. As oito primeiras também abrem o visualizador. */
.p-step__media--guided { aspect-ratio: auto; border-radius: var(--lpt-radius-md); }
.p-step__media--guided:focus-within { outline: 2px solid var(--lpt-focus); outline-offset: 3px; }
.guided-shot { display: block; text-decoration: none; cursor: zoom-in; }
/* Todas as capturas na mesma proporção (2560 × 1400): os cartões ficam com a mesma altura.
   A imagem é ancorada no topo; nas capturas mais largas (passos 9 e 10) só as bordas laterais saem. */
.guided-shot__scene { position: relative; display: block; overflow: hidden; aspect-ratio: 2560 / 1400; }
.p-step__media--guided .p-step__img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
/* A lâmina de luz une toda a largura das duas molduras. As quatro pontas se movem com a cópia. */
.guided-shot__projection {
	position: absolute; inset: 0; pointer-events: none; container-type: inline-size;
	--small-left: var(--sx) var(--source-edge);
	--small-right: calc(var(--sx) + var(--sw)) var(--source-edge);
	--folded: polygon(var(--small-left), var(--small-right), calc(var(--sx) + var(--sw)) var(--start-edge), var(--sx) var(--start-edge));
	--open: polygon(var(--small-left), var(--small-right), calc(var(--lx) + var(--lw)) var(--lens-edge), var(--lx) var(--lens-edge));
}
.guided-shot__beam {
	position: absolute; inset: 0;
	background: linear-gradient(120deg, rgba(235,232,235,.69), rgba(220,218,222,.65));
	clip-path: var(--open);
}
.guided-shot__target, .guided-shot__lens {
	position: absolute; display: block; pointer-events: none;
	border: 2px solid #0b0a0c; border-radius: 3px;
	box-shadow: 0 0 0 1.5px #fff;
}
.guided-shot__projection .guided-shot__target {
	left: var(--sx); top: var(--sy); width: var(--sw); height: var(--sh);
	border-width: clamp(1px,.23cqw,3px);
	border-radius: clamp(2px,.33cqw,5px);
	box-shadow: 0 0 0 clamp(1px,.18cqw,2.5px) #fff, 0 1px 3px rgba(0,0,0,.45);
}
.guided-shot__lens {
	left: var(--lx); top: var(--ly); width: var(--lw); height: var(--lh);
	overflow: hidden; background: #0b0a0c;
	border-width: clamp(1.5px,.32cqw,5px); border-radius: clamp(3px,.48cqw,8px);
	box-shadow: 0 0 0 clamp(1.4px,.2cqw,3px) #fff, 0 clamp(3px,.46cqw,7px) clamp(6px,.9cqw,15px) rgba(0,0,0,.55);
}
.guided-shot__lens img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.step-viewer__image .guided-shot__projection .guided-shot__target { display: none; }
@media (prefers-reduced-motion: no-preference) {
	.guided-shot__projection.is-projecting .guided-shot__lens,
	.guided-shot__projection.is-projecting .guided-shot__beam {
		animation-duration: 950ms; animation-timing-function: cubic-bezier(.3,.03,.2,1); animation-fill-mode: both;
	}
	.guided-shot__projection.is-projecting .guided-shot__lens { animation-name: lpt-project-button; }
	.guided-shot__projection.is-projecting .guided-shot__beam { animation-name: lpt-project-beam; }
	@keyframes lpt-project-button {
		0%, 14% { left: var(--sx); top: var(--sy); width: var(--sw); height: var(--sh); }
		100% { left: var(--lx); top: var(--ly); width: var(--lw); height: var(--lh); }
	}
	@keyframes lpt-project-beam {
		0%, 14% { clip-path: var(--folded); }
		100% { clip-path: var(--open); }
	}
}
.guided-shot__bar {
	display: flex; justify-content: space-between; gap: .8rem; align-items: center;
	min-height: 43px; padding: .5rem .9rem; border-top: 1px solid var(--lpt-line);
	background: var(--lpt-surface); color: var(--lpt-text);
	font-size: .78rem; line-height: 1.35; font-weight: var(--lpt-fw-medium);
}
.guided-shot__open { display: inline-flex; align-items: center; gap: .4rem; color: var(--lpt-accent-text); }
.guided-shot__open svg { width: 16px; height: 16px; }
.guided-shot:is(:hover,:focus-visible) .guided-shot__open { text-decoration: underline; }
html.has-step-viewer { overflow: hidden; }
.step-viewer {
	position: fixed; inset: 0; width: min(94vw, 72rem); max-width: 100vw;
	height: min(88vh, 52rem); height: min(88dvh, 52rem); max-height: 100dvh;
	margin: auto; padding: 0; overflow: hidden; color-scheme: dark;
	border: 1px solid var(--lpt-frame); border-radius: var(--lpt-radius-md);
	background: var(--lpt-surface); color: var(--lpt-text);
}
.step-viewer[open] { display: flex; flex-direction: column; }
.step-viewer::backdrop { background: rgba(7,6,9,.9); }
.step-viewer__head, .step-viewer__toolbar {
	display: flex; align-items: center; justify-content: space-between; gap: .6rem;
	padding: .8rem clamp(.85rem, 2vw, 1.5rem);
}
.step-viewer__head h2 { font-size: clamp(1.05rem, 1.8vw, 1.65rem); line-height: 1.22; }
.step-viewer button {
	display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
	min-width: 42px; min-height: 42px; padding: .4rem .75rem;
	border: 1px solid var(--lpt-line-strong); border-radius: var(--lpt-radius-sm);
	background: var(--lpt-surface); color: var(--lpt-text); font-size: .84rem; line-height: 1.2;
}
.step-viewer button:disabled { opacity: .42; cursor: default; }
.step-viewer button:is(:hover,:focus-visible):not(:disabled) { border-color: var(--lpt-lilac); }
.step-viewer__close { flex: none; }
.step-viewer__close span { font-size: 1.45rem; }
.step-viewer__hint { padding: 0 clamp(.85rem, 2vw, 1.5rem) .95rem; color: var(--lpt-text-muted); font-size: var(--lpt-fs-sm); line-height: 1.4; }
.step-viewer__viewport {
	flex: 1; position: relative; min-height: 0; overflow: auto; overscroll-behavior: contain;
	display: flex; background: var(--lpt-ink); scrollbar-color: var(--lpt-lilac) var(--lpt-surface);
}
.step-viewer__viewport:focus-visible { outline-offset: -3px; }
.step-viewer__image { position: relative; flex: none; align-self: flex-start; margin: auto; }
.step-viewer__image > img { width: 100%; max-width: none; height: auto; display: block; }
.step-viewer__toolbar { flex-wrap: wrap; justify-content: flex-end; border-top: 1px solid var(--lpt-line); }
.step-viewer__zoom { display: flex; align-items: center; gap: .3rem; margin-right: auto; }
.step-viewer__zoom button { font-size: 1.25rem; }
.step-viewer__zoom output { min-width: 3.2rem; text-align: center; font-variant-numeric: tabular-nums; font-size: .85rem; }
.step-viewer [data-zoom-target] { background: var(--lpt-violet); border-color: var(--lpt-violet); color: white; }
@media (max-width: 39.99em) {
	.step-viewer { width: 100%; height: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
	.step-viewer__toolbar { justify-content: center; gap: .45rem; padding-bottom: max(.8rem, env(safe-area-inset-bottom)); }
	.step-viewer__toolbar button { min-height: 44px; padding-inline: .56rem; }
	.step-viewer__zoom { margin-inline: 0 auto; gap: .1rem; }
	.guided-shot__bar { font-size: .75rem; }
}
.p-step__media--brand {
	display: grid;
	place-items: center;
	align-content: center;
	gap: var(--lpt-space-4);
	background:
		radial-gradient(60% 70% at 50% 40%, rgba(113, 0, 245, .28), rgba(113, 0, 245, 0) 70%),
		linear-gradient(180deg, var(--lpt-plum), var(--lpt-night));
}
.p-step__mark {
	width: clamp(64px, 7vw, 104px);
	height: auto;
	aspect-ratio: 289.78 / 273.78;
	fill: var(--lpt-violet-hover);
}
.p-step__brand-label {
	color: var(--lpt-text);
	font-size: var(--lpt-fs-sm);
	font-weight: var(--lpt-fw-semibold);
	letter-spacing: var(--lpt-tracking-tight);
}

.p-step__body {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: var(--lpt-space-5);
	margin-top: clamp(1.25rem, 2.4vw, 1.75rem);
}
/* Número do passo: grande e fino, a sequência é a informação */
.p-step__num {
	min-width: 2.2ch;
	color: var(--lpt-accent-text);
	font-size: clamp(2rem, 1.5rem + 1.6vw, 3rem);
	font-weight: var(--lpt-fw-semibold);
	line-height: .9;
	letter-spacing: -.04em;
	font-variant-numeric: tabular-nums;
}
.p-step__title {
	font-size: var(--lpt-fs-h4);
	letter-spacing: var(--lpt-tracking-tight);
}
.p-step__text {
	max-width: 52ch;
	margin-top: var(--lpt-space-2);
	color: var(--lpt-text-muted);
	font-size: var(--lpt-fs-sm);
}
.p-step__note {
	max-width: 52ch;
	margin-top: var(--lpt-space-3);
	padding-left: var(--lpt-space-3);
	border-left: 2px solid var(--lpt-violet);
	color: var(--lpt-text);
	font-size: var(--lpt-fs-sm);
	font-weight: var(--lpt-fw-medium);
}
.p-step__btn {
	margin-top: var(--lpt-space-4);
}

/* ==========================================================================
   3. PROGRESSO ("Passo 3 de 10" + barra)
   ========================================================================== */
.p-steps__progress {
	display: flex;
	align-items: center;
	gap: var(--lpt-space-4);
	margin-top: clamp(1.75rem, 4vh, 3rem);
	color: var(--lpt-text-muted);
	font-size: var(--lpt-fs-xs);
	font-variant-numeric: tabular-nums;
}
.p-steps__count b {
	color: var(--lpt-text-strong);
	font-weight: var(--lpt-fw-semibold);
}
.p-steps__bar {
	position: relative;
	width: min(18rem, 40vw);
	height: 2px;
	overflow: hidden;
	border-radius: 1px;
	background: var(--lpt-line);
}
.p-steps__bar span {
	position: absolute;
	inset: 0;
	background: var(--lpt-lilac);
	transform: scaleX(var(--p, 0));
	transform-origin: left;
}

/* Telas baixas (notebook 1366×768): cartões um pouco menores para caber com o texto */
@media (min-width: 64em) and (max-height: 50em) {
	.p-step {
		width: min(44vw, 40rem);
	}
	.p-steps__progress {
		margin-top: var(--lpt-space-5);
	}
}

/* ==========================================================================
   4. CELULAR E TABLET (< 1024px): introdução em cima; passos num carrossel de arrastar
   ========================================================================== */
@media (max-width: 63.99em) {
	.p-steps {
		padding-block: var(--lpt-section-y);
	}
	.p-steps__sticky {
		position: static;
		display: block;
		height: auto;
		overflow: visible;
		padding-top: 0;
	}
	.p-steps__track {
		display: block;
		width: auto;
		padding: 0;
		transform: none !important;
	}
	.p-steps__intro {
		width: auto;
		padding-inline: var(--lpt-gutter);
	}
	.p-steps__hint-desk {
		display: none;
	}
	.p-steps__hint-touch {
		display: inline;
	}
	.p-steps__list {
		gap: var(--lpt-space-4);
		margin-top: var(--lpt-space-8);
		padding: 0 var(--lpt-gutter) var(--lpt-space-2);
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: var(--lpt-gutter);
		scrollbar-width: none;
	}
	.p-steps__list::-webkit-scrollbar {
		display: none;
	}
	.p-step {
		width: min(80vw, 34rem);           /* o próximo passo aparece na borda: convite a arrastar */
		scroll-snap-align: start;
	}
	.p-step__body {
		gap: var(--lpt-space-3);
	}
	.p-steps__progress {
		margin-top: var(--lpt-space-6);
	}
}

/* ==========================================================================
   5. CHAMADA FINAL
   ========================================================================== */
.p-steps-cta {
	margin-block: clamp(4rem, 8vw, 6.5rem) clamp(3rem, 6vw, 5rem);
}
.p-steps-cta__panel {
	display: grid;
	gap: var(--lpt-space-6);
}
.p-steps-cta__title {
	font-size: var(--lpt-fs-h3);
}
.p-steps-cta__panel p {
	margin-top: var(--lpt-space-3);
	color: var(--lpt-text-muted);
}
.p-steps-cta__actions {
	align-items: center;
	margin-top: 0;
}

@media (min-width: 48em) {
	.p-steps-cta__panel {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
	}
}
@media (max-width: 47.99em) {
	.p-steps-cta__actions .c-btn {
		flex: 1 1 100%;
	}
	.p-steps-cta__actions .c-link {
		margin-inline: auto;
	}
}
