/* =====================================================
 * AppAgentix - Legal pages & Thank You page
 *
 * Used by:
 *   page-terms-and-conditions.php
 *   page-privacy-policy.php
 *   page-cookie-policy.php
 *   page-thank-you.php
 *
 * Built from the same design tokens as the landing pages
 * (assets/css/Appagentix-*.css) so these pages sit inside the
 * existing visual system: Poppins, #654dff primary, #120d26 dark,
 * 1200px container, 4px radii, 44px buttons.
 *
 * Enqueued from inc/scripts.php.
 * ===================================================== */

.lg-page {
	--lg-font: 'Poppins', Arial, sans-serif;
	--lg-primary: #654dff;
	--lg-primary-hover: #5642e8;
	--lg-primary-soft: #eef0ff;
	--lg-purple: #973dd9;
	--lg-dark: #120d26;
	--lg-ink: #111;
	--lg-sub: rgba(0, 0, 0, .62);
	--lg-muted: rgba(0, 0, 0, .48);
	--lg-border: #e2e2e2;
	--lg-hairline: #ececf1;
	--lg-light: #f5f5f7;
	--lg-soft: #fcfbf9;
	--lg-white: #fff;
	--lg-lavender: #f5f0ff;
	--lg-lavender-dark: #e6dbfc;
	--lg-shadow: 0 20px 45px rgba(18, 13, 38, .08);

	--lg-measure: 760px;
	--lg-toc-width: 248px;
	--lg-sticky-top: 96px;

	font-family: var(--lg-font);
	color: var(--lg-ink);
	background: var(--lg-white);
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
}

.lg-page *,
.lg-page *::before,
.lg-page *::after {
	box-sizing: border-box;
}

body.lg-body {
	margin: 0;
	background: var(--lg-white);
}

.lg-page img {
	max-width: 100%;
	height: auto;
}

/* The global header stylesheet removes every focus ring; restore a
   visible one for keyboard users on these pages. */
.lg-page a:focus-visible,
.lg-page button:focus-visible,
.lg-page summary:focus-visible {
	outline: 2px solid var(--lg-primary);
	outline-offset: 3px;
	border-radius: 2px;
}

/* .lg-container takes its width from layout.css. */

/* ===== Skip link ===== */
.lg-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	padding: 12px 20px;
	background: var(--lg-dark);
	color: var(--lg-white);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	border-radius: 0 0 4px 0;
}

.lg-skip:focus {
	left: 0;
}

/* Visible to screen readers only. Defined here because the parent
   theme ships no front-end .screen-reader-text rule. */
.lg-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ===== Page title band ===== */
.lg-hero {
	position: relative;
	padding: 64px 0 56px;
	background:
		radial-gradient(120% 140% at 12% 0%, rgba(101, 77, 255, .10) 0%, rgba(101, 77, 255, 0) 55%),
		radial-gradient(100% 140% at 92% 10%, rgba(151, 61, 217, .10) 0%, rgba(151, 61, 217, 0) 58%),
		var(--lg-lavender);
	border-bottom: 1px solid var(--lg-lavender-dark);
}

.lg-hero__inner {
	max-width: 860px;
}

.lg-breadcrumb {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--lg-sub);
}

.lg-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lg-breadcrumb li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.lg-breadcrumb li + li::before {
	content: '';
	width: 5px;
	height: 5px;
	border-right: 1.5px solid rgba(0, 0, 0, .3);
	border-bottom: 1.5px solid rgba(0, 0, 0, .3);
	transform: rotate(-45deg);
}

.lg-breadcrumb a {
	color: var(--lg-sub);
	text-decoration: none;
}

.lg-breadcrumb a:hover {
	color: var(--lg-primary);
	text-decoration: underline;
}

.lg-breadcrumb [aria-current='page'] {
	color: var(--lg-ink);
	font-weight: 500;
}

.lg-eyebrow {
	display: inline-block;
	margin: 0 0 14px;
	padding: 6px 14px;
	border-radius: 100px;
	background: var(--lg-white);
	border: 1px solid var(--lg-lavender-dark);
	color: var(--lg-primary);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	line-height: 1.4;
}

.lg-hero__title {
	margin: 0;
	/* Shared display scale - see layout.css. */
	font-size: var(--display-size);
	line-height: var(--display-lh);
	font-weight: var(--display-weight);
	letter-spacing: var(--display-ls);
	color: var(--lg-dark);
}

.lg-hero__lead {
	margin: 18px 0 0;
	max-width: 68ch;
	font-size: 17px;
	line-height: 1.7;
	color: var(--lg-sub);
}

.lg-hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 28px;
	margin: 26px 0 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	color: var(--lg-muted);
}

.lg-hero__meta li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.lg-hero__meta strong {
	color: var(--lg-ink);
	font-weight: 600;
}

/* ===== Body layout ===== */
.lg-body-wrap {
	padding: 64px 0 88px;
}

.lg-layout {
	display: grid;
	grid-template-columns: var(--lg-toc-width) minmax(0, 1fr);
	gap: 64px;
	align-items: start;
}

/* ===== Table of contents ===== */
.lg-toc {
	position: sticky;
	top: var(--lg-sticky-top);
	max-height: calc(100vh - var(--lg-sticky-top) - 32px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-right: 8px;
}

.lg-toc__title {
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--lg-muted);
}

.lg-toc__list {
	margin: 0;
	padding: 0 0 0 1px;
	list-style: none;
	border-left: 1px solid var(--lg-hairline);
}

.lg-toc__list a {
	display: block;
	position: relative;
	margin-left: -1px;
	padding: 7px 0 7px 16px;
	border-left: 2px solid transparent;
	font-size: 14px;
	line-height: 1.45;
	color: var(--lg-sub);
	text-decoration: none;
	transition: color .2s ease, border-color .2s ease;
}

.lg-toc__list a:hover {
	color: var(--lg-primary);
}

.lg-toc__list a.is-current {
	color: var(--lg-primary);
	font-weight: 600;
	border-left-color: var(--lg-primary);
}

/* On desktop the disclosure is transparent: the summary is hidden and
   the panel reads as a plain list. The mobile treatment is in the
   max-width: 1024px block below. */
.lg-toc__disclosure > summary {
	display: none;
}

/* ===== Content column ===== */
.lg-content {
	max-width: var(--lg-measure);
	min-width: 0;
}

.lg-intro {
	margin: 0 0 44px;
	padding: 24px 26px;
	background: var(--lg-primary-soft);
	border: 1px solid var(--lg-lavender-dark);
	border-radius: 6px;
	font-size: 16px;
	line-height: 1.75;
	color: var(--lg-sub);
}

.lg-intro > :first-child {
	margin-top: 0;
}

.lg-intro > :last-child {
	margin-bottom: 0;
}

.lg-section {
	padding-top: 12px;
	margin-bottom: 52px;
	scroll-margin-top: calc(var(--lg-sticky-top) + 8px);
}

.lg-section:last-child {
	margin-bottom: 0;
}

.lg-section > h2 {
	margin: 0 0 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--lg-hairline);
	font-size: clamp(22px, 2.4vw, 28px);
	line-height: 1.3;
	font-weight: 600;
	letter-spacing: -.01em;
	color: var(--lg-dark);
}

.lg-section h3 {
	margin: 34px 0 12px;
	font-size: 18px;
	line-height: 1.45;
	font-weight: 600;
	color: var(--lg-dark);
}

.lg-section h4 {
	margin: 26px 0 10px;
	font-size: 16px;
	line-height: 1.5;
	font-weight: 600;
	color: var(--lg-dark);
}

.lg-section p {
	margin: 0 0 18px;
	font-size: 16px;
	line-height: 1.8;
	color: var(--lg-sub);
}

.lg-section p:last-child {
	margin-bottom: 0;
}

.lg-section a {
	color: var(--lg-primary);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.lg-section a:hover {
	color: var(--lg-primary-hover);
	text-decoration-thickness: 2px;
}

.lg-section ul,
.lg-section ol {
	margin: 0 0 20px;
	padding-left: 22px;
	color: var(--lg-sub);
}

.lg-section li {
	margin-bottom: 10px;
	font-size: 16px;
	line-height: 1.75;
	padding-left: 4px;
}

.lg-section li:last-child {
	margin-bottom: 0;
}

.lg-section li::marker {
	color: var(--lg-primary);
}

.lg-section li > strong:first-child {
	color: var(--lg-ink);
	font-weight: 600;
}

.lg-section ul ul,
.lg-section ol ol,
.lg-section ul ol,
.lg-section ol ul {
	margin: 10px 0 0;
}

/* Definition-style list used in the Definitions section. */
.lg-defs {
	margin: 0 0 20px;
	padding: 0;
}

.lg-defs dt {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 600;
	color: var(--lg-ink);
}

.lg-defs dd {
	margin: 0 0 18px;
	font-size: 16px;
	line-height: 1.8;
	color: var(--lg-sub);
}

.lg-defs dd:last-child {
	margin-bottom: 0;
}

/* Callout for items the business must confirm. */
.lg-note {
	margin: 0 0 22px;
	padding: 16px 20px;
	border-left: 3px solid var(--lg-purple);
	border-radius: 0 6px 6px 0;
	background: #faf5ff;
	font-size: 15px;
	line-height: 1.7;
	color: var(--lg-sub);
}

.lg-note > :first-child {
	margin-top: 0;
}

.lg-note > :last-child {
	margin-bottom: 0;
}

.lg-note strong {
	color: var(--lg-purple);
}

/* Inline placeholder the business still has to fill in. Deliberately
   conspicuous so nothing ships unresolved - search the templates for
   "lg-todo" to find every one. */
.lg-todo {
	padding: 1px 6px;
	border-radius: 3px;
	background: #fff4d6;
	box-shadow: inset 0 0 0 1px #f0d189;
	color: #7a5200;
	font-weight: 500;
}

/* ===== Cookie / data tables ===== */
/* Horizontally scrollable on narrow screens. It carries tabindex="0" so
   keyboard users can reach and scroll it, which needs a focus ring. */
.lg-table-wrap {
	margin: 0 0 22px;
	overflow-x: auto;
	border: 1px solid var(--lg-border);
	border-radius: 6px;
	-webkit-overflow-scrolling: touch;
}

.lg-page .lg-table-wrap:focus-visible {
	outline: 2px solid var(--lg-primary);
	outline-offset: 2px;
}

.lg-table {
	width: 100%;
	min-width: 520px;
	border-collapse: collapse;
	font-size: 15px;
	line-height: 1.6;
}

.lg-table caption {
	padding: 14px 18px;
	text-align: left;
	font-size: 14px;
	font-weight: 600;
	color: var(--lg-muted);
	border-bottom: 1px solid var(--lg-border);
	background: var(--lg-light);
}

.lg-table th,
.lg-table td {
	padding: 13px 18px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--lg-hairline);
}

.lg-table thead th {
	background: var(--lg-light);
	font-weight: 600;
	color: var(--lg-ink);
	white-space: nowrap;
}

.lg-table tbody td {
	color: var(--lg-sub);
}

.lg-table tbody th {
	font-weight: 600;
	color: var(--lg-ink);
}

.lg-table tbody tr:last-child th,
.lg-table tbody tr:last-child td {
	border-bottom: 0;
}

.lg-table code {
	font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 13px;
	padding: 2px 6px;
	border-radius: 3px;
	background: var(--lg-primary-soft);
	color: var(--lg-dark);
}

/* ===== Closing contact card ===== */
.lg-contact-card {
	margin-top: 56px;
	padding: 32px 34px;
	border: 1px solid var(--lg-lavender-dark);
	border-radius: 8px;
	background: var(--lg-lavender);
}

.lg-contact-card h2 {
	margin: 0 0 10px;
	padding: 0;
	border: 0;
	font-size: 22px;
	line-height: 1.35;
	font-weight: 600;
	color: var(--lg-dark);
}

.lg-contact-card p {
	margin: 0 0 18px;
	font-size: 16px;
	line-height: 1.75;
	color: var(--lg-sub);
}

.lg-contact-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 10px;
	font-size: 16px;
	color: var(--lg-sub);
}

.lg-contact-list a {
	color: var(--lg-primary);
	text-decoration: none;
	font-weight: 500;
}

.lg-contact-list a:hover {
	text-decoration: underline;
}

.lg-contact-list strong {
	color: var(--lg-ink);
	font-weight: 600;
}

/* ===== Cross-links between the three policies ===== */
.lg-related {
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--lg-hairline);
}

.lg-related h2 {
	margin: 0 0 18px;
	padding: 0;
	border: 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--lg-dark);
}

.lg-related__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 14px;
}

.lg-related__card {
	display: block;
	padding: 18px 20px;
	border: 1px solid var(--lg-border);
	border-radius: 6px;
	background: var(--lg-white);
	text-decoration: none;
	transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.lg-related__card:hover {
	border-color: var(--lg-primary);
	transform: translateY(-2px);
	box-shadow: var(--lg-shadow);
}

.lg-related__card span {
	display: block;
	font-size: 16px;
	font-weight: 600;
	color: var(--lg-dark);
	margin-bottom: 4px;
}

.lg-related__card small {
	display: block;
	font-size: 14px;
	line-height: 1.55;
	color: var(--lg-sub);
}

/* ===== Buttons (mirrors .lp-btn from the landing pages) ===== */
.lg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 44px;
	padding: 0 30px;
	border: 0;
	border-radius: 4px;
	font-family: var(--lg-font);
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}

.lg-btn--primary {
	background: var(--lg-primary);
	color: var(--lg-white);
}

.lg-btn--primary:hover {
	background: var(--lg-primary-hover);
	transform: translateY(-2px);
	box-shadow: 0 16px 32px rgba(101, 77, 255, .3);
}

.lg-btn--ghost {
	background: transparent;
	color: var(--lg-dark);
	border: 1px solid #cfcfd4;
}

.lg-btn--ghost:hover {
	border-color: var(--lg-primary);
	color: var(--lg-primary);
	transform: translateY(-2px);
}

/* =====================================================
 * Thank You page
 * ===================================================== */

.lg-thanks {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 68vh;
	padding: 80px 0 96px;
	background:
		radial-gradient(90% 120% at 50% 0%, rgba(101, 77, 255, .09) 0%, rgba(101, 77, 255, 0) 60%),
		var(--lg-soft);
}

.lg-thanks__inner {
	max-width: 660px;
	margin: 0 auto;
	text-align: center;
}

.lg-thanks__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 96px;
	height: 96px;
	margin-bottom: 30px;
	border-radius: 50%;
	background: var(--lg-white);
	border: 1px solid var(--lg-lavender-dark);
	box-shadow: var(--lg-shadow);
}

.lg-thanks__badge svg {
	width: 46px;
	height: 46px;
	display: block;
}

/* Draw the check mark once on load. */
.lg-thanks__check {
	stroke-dasharray: 48;
	stroke-dashoffset: 48;
	animation: lg-draw .6s ease .15s forwards;
}

.lg-thanks__ring {
	transform-origin: center;
	animation: lg-pop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}

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

@keyframes lg-pop {
	from {
		transform: scale(.7);
		opacity: 0;
	}

	to {
		transform: scale(1);
		opacity: 1;
	}
}

.lg-thanks__title {
	margin: 0 0 14px;
	/* Shared display scale - see layout.css. */
	font-size: var(--display-size);
	line-height: var(--display-lh);
	font-weight: var(--display-weight);
	letter-spacing: var(--display-ls);
	color: var(--lg-dark);
}

.lg-thanks__sub {
	margin: 0 0 14px;
	font-size: clamp(18px, 2.2vw, 22px);
	line-height: 1.5;
	font-weight: 500;
	color: var(--lg-ink);
}

.lg-thanks__text {
	margin: 0 auto 34px;
	max-width: 54ch;
	font-size: 16px;
	line-height: 1.8;
	color: var(--lg-sub);
}

.lg-thanks__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-bottom: 52px;
}

/* "What happens next" steps */
.lg-steps {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: left;
	counter-reset: lg-step;
}

.lg-steps li {
	position: relative;
	padding: 24px 22px 22px;
	border: 1px solid var(--lg-border);
	border-radius: 8px;
	background: var(--lg-white);
	counter-increment: lg-step;
}

.lg-steps li::before {
	content: counter(lg-step);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin-bottom: 14px;
	border-radius: 50%;
	background: var(--lg-primary-soft);
	color: var(--lg-primary);
	font-size: 14px;
	font-weight: 700;
}

.lg-steps strong {
	display: block;
	margin-bottom: 6px;
	font-size: 16px;
	font-weight: 600;
	color: var(--lg-dark);
}

.lg-steps span {
	display: block;
	font-size: 14px;
	line-height: 1.65;
	color: var(--lg-sub);
}

/* =====================================================
 * Responsive
 * ===================================================== */

@media (max-width: 1024px) {
	.lg-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	/* Swap the sticky rail for a collapsible disclosure. */
	.lg-toc {
		position: static;
		max-height: none;
		overflow: visible;
		padding-right: 0;
		margin-bottom: 40px;
	}

	.lg-toc__title {
		display: none;
	}

	.lg-toc__disclosure {
		border: 1px solid var(--lg-border);
		border-radius: 6px;
		background: var(--lg-white);
	}

	.lg-toc__disclosure > summary {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 15px 20px;
		font-size: 15px;
		font-weight: 600;
		color: var(--lg-dark);
		cursor: pointer;
		list-style: none;
	}

	.lg-toc__disclosure > summary::-webkit-details-marker {
		display: none;
	}

	.lg-toc__disclosure > summary::after {
		content: '';
		flex: none;
		width: 8px;
		height: 8px;
		border-right: 2px solid var(--lg-primary);
		border-bottom: 2px solid var(--lg-primary);
		transform: rotate(45deg) translate(-2px, -2px);
		transition: transform .25s ease;
	}

	.lg-toc__disclosure[open] > summary::after {
		transform: rotate(-135deg) translate(-2px, -2px);
	}

	.lg-toc__panel {
		padding: 4px 20px 18px;
		border-top: 1px solid var(--lg-hairline);
	}

	.lg-toc__list {
		border-left: 0;
		padding-left: 0;
	}

	.lg-toc__list a {
		margin-left: 0;
		padding: 9px 0;
		border-left: 0;
	}

	.lg-toc__list a.is-current {
		border-left: 0;
	}
}

@media (max-width: 782px) {
	.lg-hero {
		padding: 44px 0 40px;
	}

	.lg-body-wrap {
		padding: 44px 0 64px;
	}

	.lg-section {
		margin-bottom: 42px;
	}

	.lg-section p,
	.lg-section li {
		font-size: 16px;
		line-height: 1.75;
	}

	.lg-contact-card {
		padding: 26px 22px;
	}

	.lg-steps {
		grid-template-columns: minmax(0, 1fr);
	}

	.lg-thanks {
		min-height: 0;
		padding: 56px 0 72px;
	}

	.lg-thanks__actions .lg-btn {
		width: 100%;
	}
}

@media (max-width: 560px) {
	.lg-container {
		padding: 0 16px;
	}

	.lg-intro {
		padding: 20px 18px;
	}

	.lg-thanks__badge {
		width: 80px;
		height: 80px;
	}

	.lg-thanks__badge svg {
		width: 38px;
		height: 38px;
	}
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
	.lg-page * {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
	}

	.lg-thanks__check {
		stroke-dashoffset: 0;
		animation: none;
	}

	.lg-thanks__ring {
		transform: none;
		opacity: 1;
		animation: none;
	}

	.lg-btn:hover,
	.lg-related__card:hover {
		transform: none;
	}
}
