/* Pagina "Preparando seu download" (/baixar/<id>/) */

.mdi-gate-wrap {
	max-width: 760px;
	margin: 0 auto;
	padding: 10px 0 40px;
}

.mdi-gate {
	position: relative;
	padding: 36px;
	background: var(--card-bg, #fff);
	border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
	border-radius: 24px;
	box-shadow: var(--shadow-soft, 0 14px 40px rgba(15, 23, 42, 0.08));
	overflow: hidden;
	text-align: center;
}

.mdi-gate::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 5px;
	background: var(--mc-gradient, linear-gradient(90deg, #2563eb 0%, #00c6ff 100%));
}

.mdi-gate-glow {
	position: absolute;
	top: -140px;
	left: 50%;
	width: 420px;
	height: 280px;
	background: radial-gradient(closest-side, rgba(37, 99, 235, 0.18), transparent);
	transform: translateX(-50%);
	pointer-events: none;
}

.mdi-gate > :not(.mdi-gate-glow) {
	position: relative;
}

/* Cabecalho: icone + nome */
.mdi-gate-head {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-bottom: 26px;
	text-align: left;
}

.mdi-gate-icon {
	flex: 0 0 auto;
}

.mdi-gate-icon .download-logo,
.mdi-gate-icon .download-icon {
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	border-radius: 20px;
	object-fit: cover;
	font-size: 1.1rem;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.mdi-gate-title {
	min-width: 0;
}

.mdi-gate-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 6px;
	padding: 4px 10px;
	background: rgba(34, 197, 94, 0.12);
	border-radius: 999px;
	color: #16a34a;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.mdi-gate-badge svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
}

.mdi-gate-title h1 {
	margin: 0 0 6px;
	color: var(--text-main, #1e293b);
	font-family: "Outfit", Arial, sans-serif;
	font-size: clamp(1.5rem, 4vw, 2.1rem);
	font-weight: 900;
	line-height: 1.15;
	overflow-wrap: anywhere;
}

.mdi-gate-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.mdi-gate-meta span {
	padding: 3px 10px;
	background: var(--search-bg, #f1f5f9);
	border-radius: 999px;
	color: var(--text-muted, #64748b);
	font-size: 0.78rem;
	font-weight: 600;
}

/* Etapas (quando exige inscricao) */
.mdi-gate-steps {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 0 0 26px;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.mdi-gate-steps li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 14px 7px 7px;
	background: var(--search-bg, #f1f5f9);
	border-radius: 999px;
	color: var(--text-muted, #64748b);
	font-size: 0.85rem;
	font-weight: 700;
	white-space: nowrap;
	transition: 0.3s;
}

.mdi-gate-steps li span {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	background: var(--border, rgba(0, 0, 0, 0.08));
	border-radius: 50%;
	font-size: 0.78rem;
}

.mdi-gate-steps li.is-active {
	background: rgba(37, 99, 235, 0.12);
	color: var(--primary, #2563eb);
}

.mdi-gate-steps li.is-active span {
	background: var(--primary, #2563eb);
	color: #fff;
}

.mdi-gate-steps li.is-done {
	color: #16a34a;
}

.mdi-gate-steps li.is-done span {
	background: #16a34a;
	color: #fff;
}

.mdi-gate-panel {
	animation: mdi-gate-in 0.45s ease both;
}

.mdi-gate-panel[hidden] {
	display: none;
}

@keyframes mdi-gate-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

.mdi-gate-lead {
	max-width: 520px;
	margin: 0 auto 20px;
	color: var(--text-main, #1e293b);
	font-size: 1.02rem;
	line-height: 1.6;
}

.mdi-gate-hint {
	margin: 14px 0 0;
	color: var(--text-muted, #64748b);
	font-size: 0.85rem;
}

/* Botao do YouTube */
.mdi-gate-yt-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 15px 28px;
	background: #ff0000;
	border-radius: 14px;
	box-shadow: 0 12px 28px rgba(255, 0, 0, 0.3);
	color: #fff !important;
	font-size: 1.05rem;
	font-weight: 800;
	text-decoration: none !important;
	animation: mdi-gate-pulse-red 2s infinite;
}

.mdi-gate-yt-btn svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}

.mdi-gate-yt-btn:hover {
	filter: brightness(1.08);
	transform: translateY(-2px);
}

@keyframes mdi-gate-pulse-red {
	0%, 100% { box-shadow: 0 12px 28px rgba(255, 0, 0, 0.3), 0 0 0 0 rgba(255, 0, 0, 0.45); }
	50% { box-shadow: 0 12px 28px rgba(255, 0, 0, 0.3), 0 0 0 12px rgba(255, 0, 0, 0); }
}

/* "Verificando inscricao" (apos clicar em Inscrever-se) */
.mdi-gate-verify-icon {
	position: relative;
	width: 120px;
	height: 120px;
	margin: 4px auto 18px;
}

.mdi-gate-verify-orbit {
	position: absolute;
	inset: 0;
	border: 4px solid rgba(255, 0, 0, 0.12);
	border-top-color: #ff0000;
	border-right-color: #ff4d4d;
	border-radius: 50%;
	animation: mdi-gate-spin 1s linear infinite;
	animation-play-state: paused;
	transition: border-color 0.4s, transform 0.4s;
}

.mdi-gate-verify-logo,
.mdi-gate-verify-ok {
	position: absolute;
	inset: 16px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	transition: transform 0.45s cubic-bezier(.3, 1.6, .5, 1), opacity 0.3s;
}

.mdi-gate-verify-logo {
	background: rgba(255, 0, 0, 0.08);
}

.mdi-gate-verify-logo svg {
	width: 46px;
	height: 46px;
	fill: #ff0000;
}

.mdi-gate-verify-ok {
	background: #16a34a;
	box-shadow: 0 10px 26px rgba(22, 163, 74, 0.35);
	opacity: 0;
	transform: scale(0.4);
}

.mdi-gate-verify-ok svg {
	width: 56px;
	height: 56px;
}

.mdi-gate-verify-ok path {
	fill: none;
	stroke: #fff;
	stroke-width: 5;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 40;
	stroke-dashoffset: 40;
}

.mdi-gate-verify.is-checking .mdi-gate-verify-orbit {
	animation-play-state: running;
}

.mdi-gate-verify.is-checking .mdi-gate-verify-logo {
	animation: mdi-gate-heartbeat 1.1s ease-in-out infinite;
}

@keyframes mdi-gate-heartbeat {
	0%, 100% { transform: scale(1); }
	40% { transform: scale(1.08); }
}

.mdi-gate-verify.is-ok .mdi-gate-verify-orbit {
	border-color: rgba(22, 163, 74, 0.25);
	transform: scale(1.06);
}

.mdi-gate-verify.is-ok .mdi-gate-verify-logo {
	opacity: 0;
	transform: scale(0.4);
}

.mdi-gate-verify.is-ok .mdi-gate-verify-ok {
	opacity: 1;
	transform: scale(1);
}

.mdi-gate-verify.is-ok .mdi-gate-verify-ok path {
	animation: mdi-gate-draw 0.4s 0.15s ease forwards;
}

.mdi-gate-verify-bar {
	width: 100%;
	max-width: 300px;
	height: 6px;
	margin: 0 auto;
	background: var(--search-bg, #eef2f7);
	border-radius: 999px;
	overflow: hidden;
}

.mdi-gate-verify-bar span {
	display: block;
	width: 0;
	height: 100%;
	background: linear-gradient(90deg, #ff0000, #ff6b6b);
	border-radius: inherit;
	transition: background 0.4s;
}

.mdi-gate-verify.is-ok .mdi-gate-verify-bar span {
	background: #16a34a;
}

.mdi-gate-verify.is-ok .mdi-gate-status {
	color: #16a34a;
}

/* Contagem regressiva em anel */
.mdi-gate-ring {
	position: relative;
	width: 180px;
	height: 180px;
	margin: 0 auto 18px;
}

.mdi-gate-ring svg {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.mdi-gate-ring circle {
	fill: none;
	stroke-width: 9;
}

.mdi-gate-ring-track {
	stroke: var(--search-bg, #eef2f7);
}

.mdi-gate-ring-bar {
	stroke: url(#mdiGateGradient);
	stroke-linecap: round;
	transition: stroke-dashoffset 0.25s linear;
	filter: drop-shadow(0 0 6px rgba(0, 198, 255, 0.45));
}

.mdi-gate-ring-center {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.mdi-gate-ring-center strong {
	background: var(--mc-gradient, linear-gradient(90deg, #2563eb 0%, #00c6ff 100%));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-family: "Outfit", Arial, sans-serif;
	font-size: 3.4rem;
	font-weight: 900;
	line-height: 1;
}

.mdi-gate-ring-center small {
	margin-top: 4px;
	color: var(--text-muted, #64748b);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mdi-gate-ring.is-ticking strong {
	animation: mdi-gate-tick 1s ease infinite;
}

@keyframes mdi-gate-tick {
	0% { transform: scale(1.12); }
	30% { transform: scale(1); }
}

.mdi-gate-status {
	margin: 0 0 14px;
	color: var(--text-main, #1e293b);
	font-family: "Outfit", Arial, sans-serif;
	font-size: 1.2rem;
	font-weight: 800;
}

.mdi-gate-checks {
	display: inline-flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: left;
}

.mdi-gate-checks li {
	position: relative;
	padding-left: 28px;
	color: var(--text-muted, #64748b);
	font-size: 0.92rem;
	opacity: 0.55;
	transition: 0.3s;
}

.mdi-gate-checks li::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 16px;
	height: 16px;
	margin-top: -9px;
	border: 2px solid var(--border, rgba(0, 0, 0, 0.15));
	border-radius: 50%;
}

.mdi-gate-checks li.is-running {
	color: var(--text-main, #1e293b);
	opacity: 1;
}

.mdi-gate-checks li.is-running::before {
	border-color: var(--primary, #2563eb);
	border-right-color: transparent;
	animation: mdi-gate-spin 0.8s linear infinite;
}

.mdi-gate-checks li.is-done {
	color: var(--text-main, #1e293b);
	opacity: 1;
}

.mdi-gate-checks li.is-done::before {
	background: #16a34a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='4' d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 10px no-repeat;
	border-color: #16a34a;
}

@keyframes mdi-gate-spin {
	to { transform: rotate(360deg); }
}

/* Pronto */
.mdi-gate-check {
	width: 86px;
	height: 86px;
	margin: 0 auto 14px;
}

.mdi-gate-check svg {
	width: 100%;
	height: 100%;
}

.mdi-gate-check circle {
	fill: rgba(34, 197, 94, 0.12);
	stroke: #16a34a;
	stroke-width: 2.5;
	stroke-dasharray: 151;
	stroke-dashoffset: 151;
	animation: mdi-gate-draw 0.6s ease forwards;
}

.mdi-gate-check path {
	fill: none;
	stroke: #16a34a;
	stroke-width: 4;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 40;
	stroke-dashoffset: 40;
	animation: mdi-gate-draw 0.4s 0.45s ease forwards;
}

@keyframes mdi-gate-draw {
	to { stroke-dashoffset: 0; }
}

.mdi-gate-download-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 16px 34px;
	background: var(--mc-gradient, linear-gradient(90deg, #2563eb 0%, #00c6ff 100%));
	border-radius: 14px;
	box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
	color: #fff !important;
	font-size: 1.1rem;
	font-weight: 900;
	text-decoration: none !important;
	animation: mdi-gate-pulse-blue 2s infinite;
}

.mdi-gate-download-btn svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.mdi-gate-download-btn:hover {
	filter: brightness(1.08);
	transform: translateY(-2px);
}

@keyframes mdi-gate-pulse-blue {
	0%, 100% { box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35), 0 0 0 0 rgba(0, 198, 255, 0.5); }
	50% { box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35), 0 0 0 14px rgba(0, 198, 255, 0); }
}

.mdi-gate-destination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 26px 0 0;
	padding-top: 18px;
	border-top: 1px dashed var(--border, rgba(0, 0, 0, 0.1));
	color: var(--text-muted, #64748b);
	font-size: 0.85rem;
}

.mdi-gate-destination svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.mdi-gate-ad {
	margin: 24px 0 0;
}

.mdi-gate-ad:empty {
	display: none;
}

.mdi-gate-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	margin-top: 22px;
	font-size: 0.9rem;
	font-weight: 700;
}

.mdi-gate-links a {
	color: var(--primary, #2563eb);
}

.mdi-gate-links a:hover {
	text-decoration: underline;
}

/* Telas baixas (notebooks): cartao compacto pra caber inteiro abaixo do
   cabecalho fixo do site. */
@media (max-height: 900px) {
	.mdi-gate {
		padding: 24px 28px;
	}

	.mdi-gate-head {
		margin-bottom: 16px;
	}

	.mdi-gate-icon .download-logo,
	.mdi-gate-icon .download-icon {
		width: 60px;
		height: 60px;
		border-radius: 16px;
	}

	.mdi-gate-title h1 {
		font-size: clamp(1.35rem, 3vw, 1.75rem);
	}

	.mdi-gate-steps {
		margin-bottom: 16px;
	}

	.mdi-gate-lead {
		margin-bottom: 14px;
		font-size: 0.95rem;
	}

	.mdi-gate-ring {
		width: 130px;
		height: 130px;
		margin-bottom: 12px;
	}

	.mdi-gate-ring-center strong {
		font-size: 2.6rem;
	}

	.mdi-gate-status {
		margin-bottom: 10px;
		font-size: 1.08rem;
	}

	.mdi-gate-checks {
		gap: 4px;
	}

	.mdi-gate-checks li {
		font-size: 0.85rem;
	}

	.mdi-gate-verify-icon {
		width: 96px;
		height: 96px;
		margin-bottom: 12px;
	}

	.mdi-gate-verify-logo,
	.mdi-gate-verify-ok {
		inset: 13px;
	}

	.mdi-gate-check {
		width: 64px;
		height: 64px;
		margin-bottom: 10px;
	}

	.mdi-gate-download-btn,
	.mdi-gate-yt-btn {
		padding: 13px 26px;
	}

	.mdi-gate-hint {
		margin-top: 10px;
	}

	.mdi-gate-destination {
		margin-top: 16px;
		padding-top: 12px;
	}
}

@media (max-width: 620px) {
	.mdi-gate {
		padding: 26px 18px;
		border-radius: 18px;
	}

	.mdi-gate-head {
		flex-direction: column;
		text-align: center;
	}

	.mdi-gate-meta {
		justify-content: center;
	}

	.mdi-gate-steps {
		gap: 4px;
	}

	.mdi-gate-steps li {
		gap: 5px;
		padding: 5px 8px 5px 5px;
		font-size: 0.74rem;
	}

	.mdi-gate-steps li span {
		width: 20px;
		height: 20px;
	}

	.mdi-gate-ring {
		width: 150px;
		height: 150px;
	}

	.mdi-gate-links {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mdi-gate *,
	.mdi-gate *::before {
		animation: none !important;
		transition: none !important;
	}

	.mdi-gate-check circle,
	.mdi-gate-check path {
		stroke-dashoffset: 0;
	}
}

/* Imagem do programa como icone: logo inteiro, sem corte. */
.mdi-gate-icon .download-logo {
	padding: 8px;
	background: var(--card-bg, #fff);
	border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
	object-fit: contain;
}
