/*
 * Página /app/ (patterns/app-page.php). Solo se carga en esa página.
 */

.hg-app-page {
	--hg-app-gutter: clamp(1rem, 4vw, 2.5rem);
	overflow-x: clip;
}

.hg-app-wrap {
	max-width: 1180px;
	margin-inline: auto;
	padding-inline: var(--hg-app-gutter);
}

.hg-app-wrap--narrow {
	max-width: 860px;
}

.hg-app-section {
	padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.hg-app-kicker {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--wp--preset--color--accent);
}

.hg-app-title {
	margin: 0 0 1rem;
	max-width: 22ch;
	font-size: clamp(2rem, 4.6vw, 3.25rem);
	line-height: 1.08;
	letter-spacing: -0.025em;
	font-weight: 700;
}

.hg-app-lead {
	margin: 0;
	max-width: 46rem;
	font-size: clamp(1.0625rem, 1.6vw, 1.3125rem);
	line-height: 1.5;
	color: var(--hg-muted);
}

/* Botones ------------------------------------------------------------ */

.hg-app-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0.85rem 1.6rem;
	border-radius: 999px;
	background: var(--hg-ink);
	color: #fff !important;
	font-size: 1.0625rem;
	font-weight: 600;
	text-decoration: none !important;
	transition: transform 0.2s var(--hg-ease), background-color 0.2s var(--hg-ease);
}

.hg-app-button:hover {
	background: #000;
	transform: scale(1.02);
}

.hg-app-button--light {
	background: #fff;
	color: var(--hg-ink) !important;
}

.hg-app-button--light:hover {
	background: #f5f5f7;
}

.hg-app-link {
	font-size: 1.0625rem;
	font-weight: 500;
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

.hg-app-link::after {
	content: " ›";
}

.hg-app-link:hover {
	text-decoration: underline;
}

/* Portada ------------------------------------------------------------ */

.hg-app-hero {
	padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3rem, 7vw, 5rem);
	background:
		radial-gradient(60% 70% at 85% 30%, rgba(0, 113, 227, 0.10), transparent 70%),
		radial-gradient(50% 60% at 70% 90%, rgba(255, 149, 0, 0.10), transparent 70%),
		linear-gradient(180deg, var(--hg-surface), #fff);
}

.hg-app-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: clamp(2rem, 5vw, 4rem);
	align-items: center;
}

.hg-app-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 1.25rem;
	padding: 0.35rem 0.9rem 0.35rem 0.35rem;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 1px var(--hg-line);
	font-size: 0.875rem;
	font-weight: 600;
}

.hg-app-eyebrow img {
	width: 28px;
	height: 28px;
	border-radius: 7px;
}

.hg-app-hero__title {
	margin: 0 0 1.25rem;
	font-size: clamp(2.6rem, 6.4vw, 4.75rem);
	line-height: 1.02;
	letter-spacing: -0.035em;
	font-weight: 700;
}

.hg-app-hero__lead {
	margin: 0 0 2rem;
	max-width: 34rem;
	font-size: clamp(1.125rem, 1.7vw, 1.3125rem);
	line-height: 1.5;
	color: var(--hg-muted);
}

.hg-app-hero__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.5rem;
}

.hg-app-hero__meta {
	margin: 1rem 0 0;
	font-size: 0.875rem;
	color: var(--hg-muted);
}

.hg-app-qr {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 2rem;
	max-width: 26rem;
	padding: 0.9rem;
	border-radius: var(--hg-radius-small);
	background: rgba(255, 255, 255, 0.8);
	box-shadow: 0 0 0 1px var(--hg-line);
}

.hg-app-qr img {
	flex: none;
	width: 88px;
	height: 88px;
	padding: 6px;
	border-radius: 10px;
	background: #fff;
}

.hg-app-qr p {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--hg-muted);
}

.hg-app-qr strong {
	display: block;
	color: var(--hg-ink);
}

/* Celulares de la portada (mientras no haya captura real) */
.hg-app-hero__visual {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 560px;
}

.hg-app-hero__shot {
	width: min(100%, 420px);
	height: auto;
	filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.18));
}

.hg-app-phone {
	position: relative;
	z-index: 1;
	width: min(68%, 290px);
	aspect-ratio: 9 / 19.5;
	padding: 10px;
	border-radius: 48px;
	background: #1d1d1f;
	box-shadow: 0 0 0 2px #3a3a3c inset, 0 40px 70px -20px rgba(0, 0, 0, 0.35);
}

.hg-app-phone::before {
	/* Dynamic Island */
	content: "";
	position: absolute;
	z-index: 2;
	top: 22px;
	left: 50%;
	width: 30%;
	height: 26px;
	border-radius: 999px;
	background: #000;
	transform: translateX(-50%);
}

.hg-app-phone img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 38px;
	display: block;
}

.hg-app-phone--back {
	position: absolute;
	z-index: 0;
	right: 2%;
	top: 8%;
	width: min(52%, 230px);
	opacity: 0.95;
	transform: rotate(7deg);
}

.hg-app-hero__icon {
	position: absolute;
	z-index: 2;
	left: 6%;
	bottom: 10%;
	width: clamp(84px, 11vw, 120px);
	height: auto;
	border-radius: 26%;
	box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
	animation: hg-app-float 6s var(--hg-ease) infinite alternate;
}

@keyframes hg-app-float {
	to { transform: translateY(-12px); }
}

@media (prefers-reduced-motion: reduce) {
	.hg-app-hero__icon { animation: none; }
}

/* Por qué existe ------------------------------------------------------ */

.hg-app-manifesto__text {
	margin: 0 0 2.5rem;
	font-size: clamp(1.75rem, 3.8vw, 2.75rem);
	line-height: 1.18;
	letter-spacing: -0.02em;
	font-weight: 700;
}

.hg-app-manifesto__text span {
	color: var(--hg-muted);
}

.hg-app-manifesto__cols {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem 3rem;
}

.hg-app-manifesto__cols p {
	margin: 0;
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--hg-muted);
}

/* Qué trae ------------------------------------------------------------ */

.hg-app-bento {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
	margin-top: 2.5rem;
}

.hg-app-feature {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	min-height: 15rem;
	padding: clamp(1.5rem, 3vw, 2rem);
	border-radius: var(--hg-radius);
	background: var(--hg-surface);
}

.hg-app-feature.is-wide {
	grid-column: span 2;
}

.hg-app-feature.is-full {
	grid-column: 1 / -1;
	min-height: 0;
}

.hg-app-feature.is-dark {
	background: var(--hg-ink);
	color: #fff;
}

.hg-app-feature.is-dark h3 {
	color: #fff;
}

.hg-app-feature.is-soft {
	background: linear-gradient(135deg, #e8f2ff, #f3ecff);
}

.hg-app-feature__icon {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 14px;
	background: #fff;
	color: var(--wp--preset--color--accent);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.hg-app-feature__icon svg {
	width: 26px;
	height: 26px;
}

.is-dark .hg-app-feature__icon {
	width: auto;
	height: auto;
	padding: 0;
	background: none;
	box-shadow: none;
}

.hg-app-feature__mark {
	width: 72px;
	height: auto;
	border-radius: 8px;
	background: #fff;
}

.hg-app-feature h3 {
	margin: 1.5rem 0 0;
	font-size: clamp(1.25rem, 2vw, 1.5rem);
	line-height: 1.2;
	letter-spacing: -0.01em;
	font-weight: 700;
}

.hg-app-feature.is-wide h3,
.hg-app-feature.is-full h3 {
	font-size: clamp(1.5rem, 2.8vw, 2rem);
}

.hg-app-feature p {
	margin: 0;
	max-width: 38rem;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--hg-muted);
}

.hg-app-feature.is-dark p {
	color: rgba(255, 255, 255, 0.72);
}

/* Seguimiento --------------------------------------------------------- */

.hg-app-journey {
	background: var(--hg-surface);
}

.hg-app-steps-line {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 1rem;
	margin: 3rem 0 0;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.hg-app-steps-line li {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding-top: 3.5rem;
}

.hg-app-steps-line li::before {
	/* Línea entre etapas */
	content: "";
	position: absolute;
	top: 1.25rem;
	left: 2.5rem;
	right: -1rem;
	height: 3px;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--wp--preset--color--accent), rgba(0, 113, 227, 0.25));
}

.hg-app-steps-line li:last-child::before {
	display: none;
}

.hg-app-steps-line__dot {
	position: absolute;
	top: 0;
	left: 0;
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	color: #fff;
	font-weight: 700;
	box-shadow: 0 0 0 6px var(--hg-surface);
}

.hg-app-steps-line li:last-child .hg-app-steps-line__dot {
	background: var(--wp--preset--color--success);
}

.hg-app-steps-line strong {
	font-size: 1.0625rem;
}

.hg-app-steps-line span:not(.hg-app-steps-line__dot) {
	font-size: 0.9375rem;
	line-height: 1.45;
	color: var(--hg-muted);
}

/* Capturas ------------------------------------------------------------ */

.hg-app-screens__row {
	display: flex;
	gap: 1.25rem;
	margin-top: 2.5rem;
	padding-inline: max(var(--hg-app-gutter), calc((100vw - 1180px) / 2 + var(--hg-app-gutter)));
	padding-bottom: 1rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.hg-app-screens__row::-webkit-scrollbar {
	display: none;
}

.hg-app-screens__row img {
	flex: none;
	width: clamp(220px, 26vw, 300px);
	height: auto;
	border-radius: 28px;
	scroll-snap-align: start;
	box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.25);
}

/* Cómo instalarla ----------------------------------------------------- */

.hg-app-install {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
	margin: 2.5rem 0 0;
	padding: 0;
	list-style: none;
}

.hg-app-install li {
	padding: 1.75rem;
	border-radius: var(--hg-radius);
	box-shadow: 0 0 0 1px var(--hg-line);
}

.hg-app-install__n {
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: var(--hg-ink);
	color: #fff;
	font-weight: 700;
}

.hg-app-install h3 {
	margin: 1.25rem 0 0.4rem;
	font-size: 1.25rem;
	font-weight: 700;
}

.hg-app-install p {
	margin: 0;
	line-height: 1.5;
	color: var(--hg-muted);
}

/* Preguntas ----------------------------------------------------------- */

.hg-app-faq {
	padding-top: 0;
}

.hg-app-faq details {
	border-bottom: 1px solid var(--hg-line);
}

.hg-app-faq details:first-of-type {
	margin-top: 1.5rem;
	border-top: 1px solid var(--hg-line);
}

.hg-app-faq summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: 1.25rem 0;
	font-size: 1.125rem;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}

.hg-app-faq summary::-webkit-details-marker {
	display: none;
}

.hg-app-faq summary::after {
	content: "+";
	flex: none;
	font-size: 1.5rem;
	font-weight: 400;
	color: var(--hg-muted);
	transition: transform 0.2s var(--hg-ease);
}

.hg-app-faq details[open] summary::after {
	transform: rotate(45deg);
}

.hg-app-faq details p {
	margin: 0 0 1.25rem;
	max-width: 44rem;
	line-height: 1.6;
	color: var(--hg-muted);
}

/* Llamado final ------------------------------------------------------- */

.hg-app-cta {
	margin-inline: var(--hg-app-gutter);
	padding-block: clamp(3.5rem, 8vw, 6rem);
	border-radius: calc(var(--hg-radius) * 1.5);
	background:
		radial-gradient(60% 80% at 50% 0%, rgba(0, 113, 227, 0.35), transparent 70%),
		var(--hg-ink);
	color: #fff;
	text-align: center;
}

.hg-app-cta__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
}

.hg-app-cta__icon {
	width: 96px;
	height: 96px;
	border-radius: 22px;
	box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6);
}

.hg-app-cta h2 {
	margin: 0.5rem 0 0;
	font-size: clamp(2rem, 4.6vw, 3.25rem);
	line-height: 1.08;
	letter-spacing: -0.025em;
	font-weight: 700;
	color: #fff;
}

.hg-app-cta p {
	margin: 0 0 0.75rem;
	font-size: 1.125rem;
	color: rgba(255, 255, 255, 0.72);
}

/* Letra pequeña ------------------------------------------------------- */

.hg-app-legal {
	padding-block: 2.5rem 0;
	text-align: center;
}

.hg-app-legal p {
	margin: 0 auto 0.75rem;
	max-width: 46rem;
	font-size: 0.75rem;
	line-height: 1.5;
	color: var(--hg-muted);
}

.hg-app-maker a {
	color: inherit;
	text-decoration: underline;
}

/* Tamaños ------------------------------------------------------------- */

@media (max-width: 1023px) {
	.hg-app-bento {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hg-app-steps-line {
		grid-template-columns: 1fr;
		gap: 0;
		margin-top: 2rem;
	}

	.hg-app-steps-line li {
		padding: 0 0 1.75rem 3.75rem;
		min-height: 2.5rem;
	}

	.hg-app-steps-line li::before {
		top: 2.75rem;
		bottom: 0.25rem;
		left: 1.2rem;
		right: auto;
		width: 3px;
		height: auto;
		background: linear-gradient(180deg, var(--wp--preset--color--accent), rgba(0, 113, 227, 0.25));
	}
}

@media (max-width: 781px) {
	.hg-app-hero__grid {
		grid-template-columns: 1fr;
	}

	.hg-app-hero__visual {
		min-height: 0;
		padding-block: 1rem;
	}

	.hg-app-phone {
		width: min(62%, 250px);
	}

	.hg-app-phone--back {
		right: 6%;
	}

	.hg-app-hero__icon {
		left: 4%;
	}

	/* En el celular el código QR no sirve: se escanea con otro dispositivo. */
	.hg-app-qr {
		display: none;
	}

	.hg-app-manifesto__cols,
	.hg-app-bento,
	.hg-app-install {
		grid-template-columns: 1fr;
	}

	.hg-app-feature.is-wide {
		grid-column: auto;
	}

	.hg-app-feature {
		min-height: 0;
	}

	.hg-app-hero__actions .hg-app-button {
		width: 100%;
	}
}
