/* ==========================================================================
   AlphaPros — Legal pages (template-legal.php), Sitemap (page-sitemap.php), Proposals (page-proposals.php)
   ========================================================================== */

@keyframes ap-shimmer { to { background-position: -200% 0; } }
.proposal .text-gradient {
	background-image: linear-gradient(90deg, #b57be8, #e7c4ff, #b57be8);
	background-size: 200% 100%;
	animation: ap-shimmer 6s linear infinite;
}

/* Shared title hero (legal + sitemap)
   ========================================================================== */
.legal-hero {
	position: relative;
	margin-top: calc(var(--ap-header-h) * -1);
	padding: calc(var(--ap-header-h) + clamp(56px, 8vw, 104px)) 0 clamp(44px, 6vw, 72px);
	overflow: hidden;
	isolation: isolate;
	text-align: center;
	background:
		radial-gradient(45% 80% at 50% 0%, rgba(150, 60, 210, .4), transparent 70%),
		url('../images/case-studies/hero-bg.webp') center bottom / cover no-repeat,
		#050204;
}
.legal-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 120px; z-index: -1; background: linear-gradient(180deg, transparent, var(--ap-bg)); }
.legal-hero__title { margin: 0; font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.08; }

/* Legal document
   ========================================================================== */
.legal { padding-top: clamp(32px, 4vw, 56px); }
.legal__layout { display: grid; grid-template-columns: 260px minmax(0, 760px); justify-content: center; gap: clamp(40px, 6vw, 88px); align-items: start; }
.legal__layout--plain { grid-template-columns: minmax(0, 760px); }

.legal__toc { position: sticky; top: calc(var(--ap-header-h) + 32px); }
.legal__toc-box summary {
	margin-bottom: 14px;
	font: 600 .78rem/1.4 var(--ap-font-body);
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--ap-primary-soft);
	list-style: none;
	cursor: default;
	pointer-events: none;
}
.legal__toc-box summary::-webkit-details-marker { display: none; }
.legal__toc ol { display: grid; gap: 2px; list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--ap-border); }
.legal__toc a {
	position: relative;
	display: block;
	padding: 6px 0;
	font-size: .9rem;
	line-height: 1.4;
	color: rgba(233, 227, 234, .55);
	transition: color .25s, transform .3s var(--ap-ease);
}
.legal__toc a::before {
	content: "";
	position: absolute;
	left: -15px;
	top: 6px;
	bottom: 6px;
	width: 2px;
	background: var(--ap-primary);
	border-radius: 2px;
	box-shadow: 0 0 10px rgba(175, 71, 254, .8);
	transform: scaleY(0);
	transition: transform .3s var(--ap-ease);
}
.legal__toc a:hover { color: var(--ap-white); }
.legal__toc a.is-active { color: var(--ap-white); transform: translateX(4px); }
.legal__toc a.is-active::before { transform: scaleY(1); }

.legal__content { font-size: 1.05rem; line-height: 1.9; color: var(--ap-text); }
.legal__content > :first-child { margin-top: 0; }
.legal__content h2 {
	margin: 2.4em 0 .7em;
	padding-top: 1.4em;
	font-size: clamp(1.4rem, 2.4vw, 1.75rem);
	line-height: 1.3;
	border-top: 1px solid var(--ap-border-soft);
	scroll-margin-top: calc(var(--ap-header-h) + 24px);
}
.legal__content h2:first-child { padding-top: 0; border-top: 0; }
.legal__content h3 { margin: 1.8em 0 .5em; font-size: 1.15rem; color: var(--ap-white); }
.legal__content p { margin: 0 0 1.1em; }
.legal__content strong { color: var(--ap-white); font-weight: 600; }
.legal__content ul { display: grid; gap: 10px; list-style: none; margin: 0 0 1.4em; padding: 0; }
.legal__content li { position: relative; padding-left: 26px; }
.legal__content li::before { content: ""; position: absolute; left: 4px; top: .78em; width: 7px; height: 7px; background: var(--ap-primary); border-radius: 50%; box-shadow: 0 0 0 4px rgba(175, 71, 254, .16); }
.legal__content a { color: var(--ap-primary-soft); text-decoration: underline; text-decoration-color: rgba(197, 139, 242, .4); text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
.legal__content a:hover { color: var(--ap-white); text-decoration-color: currentColor; }

/* Sitemap
   ========================================================================== */
.sitemap { padding-top: clamp(32px, 4vw, 56px); }
.sitemap__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: clamp(36px, 5vw, 64px) clamp(28px, 4vw, 56px); }
.sitemap__group { position: relative; padding-top: 22px; border-top: 1px solid var(--ap-border); }
.sitemap__group::before { content: ""; position: absolute; left: 0; top: -1px; width: 44px; height: 2px; background: var(--ap-primary); box-shadow: 0 0 12px rgba(175, 71, 254, .8); transition: width .6s var(--ap-ease); }
.sitemap__group:hover::before { width: 100%; }
.sitemap__title { margin: 0 0 14px; font: 600 .8rem/1.4 var(--ap-font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--ap-primary-soft); }
.sitemap__list { list-style: none; margin: 0; padding: 0; }
.sitemap__list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0;
	font: 600 1.1rem/1.35 var(--ap-font-heading);
	color: var(--ap-white);
	border-bottom: 1px solid var(--ap-border-soft);
	transition: color .25s, padding .35s var(--ap-ease);
}
.sitemap__list .icon { flex-shrink: 0; width: 18px; height: 18px; color: var(--ap-muted); opacity: 0; transform: translateX(-8px); transition: opacity .25s, transform .35s var(--ap-ease), color .25s; }
.sitemap__list a:hover { color: var(--ap-primary-soft); padding-left: 6px; }
.sitemap__list a:hover .icon { opacity: 1; transform: none; color: var(--ap-primary-soft); }

/* Proposals
   ========================================================================== */
.proposal {
	position: relative;
	margin-top: calc(var(--ap-header-h) * -1);
	padding: calc(var(--ap-header-h) + clamp(48px, 7vw, 96px)) 0 clamp(64px, 8vw, 112px);
	overflow: hidden;
	isolation: isolate;
	background:
		radial-gradient(40% 60% at 15% 30%, rgba(150, 60, 210, .38), transparent 70%),
		radial-gradient(40% 60% at 90% 80%, rgba(110, 40, 160, .28), transparent 70%),
		url('../images/case-studies/hero-bg.webp') center bottom / cover no-repeat,
		#050204;
}
.proposal__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(40px, 6vw, 88px); align-items: start; }
.proposal__intro { position: sticky; top: calc(var(--ap-header-h) + 40px); }
.proposal__title { font-size: clamp(2.4rem, 5vw, 3.9rem); line-height: 1.08; margin-bottom: .5em; }
.proposal__title .text-gradient { display: block; }
.proposal__text { max-width: 480px; margin: 0; font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.85; color: var(--ap-text); }

.proposal__form {
	padding: clamp(24px, 3.5vw, 44px);
	background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 26px;
	box-shadow: 0 40px 80px rgba(0, 0, 0, .45), 0 0 80px rgba(175, 71, 254, .14);
	backdrop-filter: blur(10px);
}
/* Every field full width, so long placeholders (e.g. Target Geo) are never cut off */
.proposal__form .gform_wrapper.gravity-theme .gform_fields { grid-template-columns: 1fr; }
.proposal__form .gform_wrapper.gravity-theme .gfield { grid-column: 1 / -1 !important; }
.proposal__form .gform_wrapper.gravity-theme input::placeholder,
.proposal__form .gform_wrapper.gravity-theme textarea::placeholder { font-size: .9rem; text-overflow: ellipsis; }
.proposal__form .gform_wrapper.gravity-theme .gfield--type-checkbox { padding: 14px 16px; background: rgba(175, 71, 254, .1); border: 1px solid rgba(175, 71, 254, .3); border-radius: 12px; }
.proposal__form .gform_wrapper.gravity-theme .gfield--type-checkbox > .gfield_label { display: none; }
.proposal__form .gform_wrapper.gravity-theme .gform_footer { justify-content: flex-start; }
.proposal__form .gform_wrapper.gravity-theme .gform_button { padding: .9em 2.4em; }

/* Responsive
   ========================================================================== */
@media (max-width: 960px) {
	.legal__layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.legal__toc { position: static; }
	.legal__toc-box { padding: 14px 18px; background: rgba(255, 255, 255, .03); border: 1px solid var(--ap-border-soft); border-radius: 14px; }
	.legal__toc-box summary { margin: 0; pointer-events: auto; cursor: pointer; }
	.legal__toc-box[open] summary { margin-bottom: 12px; }
	.proposal__grid { grid-template-columns: 1fr; }
	.proposal__intro { position: static; }
}

/* Thank you (page-thank-you.php)
   ========================================================================== */
.ty {
	position: relative;
	display: grid;
	place-items: center;
	min-height: calc(100vh - var(--ap-header-h) - 60px);
	margin-top: calc(var(--ap-header-h) * -1);
	padding: calc(var(--ap-header-h) + 72px) 0 96px;
	overflow: hidden;
	isolation: isolate;
	text-align: center;
	background:
		radial-gradient(40% 50% at 50% 45%, rgba(150, 60, 210, .4), transparent 70%),
		url('../images/case-studies/hero-bg.webp') center bottom / cover no-repeat,
		#050204;
}
.ty::after { content: ""; position: absolute; inset: auto 0 0; height: 140px; z-index: -1; background: linear-gradient(180deg, transparent, var(--ap-bg)); }
.ty__inner { max-width: 720px; }
.ty .text-gradient { background-image: linear-gradient(90deg, #ffffff, #d6a6f5, #ffffff); background-size: 200% 100%; animation: ap-shimmer 6s linear infinite; }
.ty__check {
	display: inline-grid;
	place-items: center;
	width: 112px;
	height: 112px;
	margin-bottom: 28px;
	color: var(--ap-primary-soft);
	background: radial-gradient(circle, rgba(175, 71, 254, .3), rgba(175, 71, 254, .05) 70%);
	border-radius: 50%;
	box-shadow: 0 0 0 1px rgba(175, 71, 254, .35), 0 0 60px rgba(175, 71, 254, .45);
	animation: ap-ty-pulse 3s ease-in-out 1.4s infinite;
}
.ty__circle { stroke-dasharray: 227; stroke-dashoffset: 227; animation: ap-ty-draw .8s var(--ap-ease) .2s forwards; }
.ty__tick { stroke-dasharray: 50; stroke-dashoffset: 50; color: var(--ap-white); animation: ap-ty-draw .5s var(--ap-ease) .85s forwards; }
@keyframes ap-ty-draw { to { stroke-dashoffset: 0; } }
@keyframes ap-ty-pulse { 50% { box-shadow: 0 0 0 1px rgba(175, 71, 254, .5), 0 0 90px rgba(175, 71, 254, .65); } }
.ty__title { margin: 0 0 .3em; font-size: clamp(3rem, 8vw, 5.5rem); line-height: 1.05; }
.ty__text { margin: 0 auto; max-width: 520px; font-size: clamp(1.1rem, 1.7vw, 1.3rem); line-height: 1.8; color: var(--ap-text); }
.ty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 2.2em; }
.ty__actions .icon { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) {
	.ty__circle, .ty__tick { stroke-dashoffset: 0; animation: none; }
}
