/**
 * CLAADSS Legal pages — Privacy, Terms, Refunds (2027 modern)
 */

.cm-legal {
	--cm-legal-ink: #0f172a;
	--cm-legal-muted: #64748b;
	--cm-legal-line: rgba(15, 23, 42, 0.08);
	--cm-legal-card: rgba(255, 255, 255, 0.82);
	--cm-legal-radius: 22px;
	--cm-legal-a1: #4f46e5;
	--cm-legal-a2: #7c3aed;
	--cm-legal-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #db2777 100%);
	position: relative;
	color: var(--cm-legal-ink);
	padding-bottom: 64px;
	background:
		radial-gradient(1200px 500px at 10% -10%, rgba(79, 70, 229, 0.12), transparent 60%),
		radial-gradient(900px 420px at 100% 0%, rgba(219, 39, 119, 0.1), transparent 55%),
		linear-gradient(180deg, #f8fafc 0%, #eef2ff 40%, #f8fafc 100%);
	min-height: 70vh;
}

.cm-legal--privacy {
	--cm-legal-a1: #0ea5e9;
	--cm-legal-a2: #6366f1;
	--cm-legal-grad: linear-gradient(135deg, #0284c7 0%, #4f46e5 50%, #7c3aed 100%);
}
.cm-legal--terms {
	--cm-legal-a1: #4f46e5;
	--cm-legal-a2: #db2777;
	--cm-legal-grad: linear-gradient(135deg, #4338ca 0%, #7c3aed 45%, #db2777 100%);
}
.cm-legal--refund {
	--cm-legal-a1: #059669;
	--cm-legal-a2: #0d9488;
	--cm-legal-grad: linear-gradient(135deg, #059669 0%, #0d9488 45%, #2563eb 100%);
}

/* Hero */
.cm-legal-hero {
	position: relative;
	overflow: hidden;
	padding: 48px 20px 56px;
	color: #fff;
	background: var(--cm-legal-grad);
	border-bottom-left-radius: 32px;
	border-bottom-right-radius: 32px;
	box-shadow: 0 24px 60px rgba(79, 70, 229, 0.22);
}
.cm-legal-hero__mesh {
	position: absolute;
	inset: 0;
	background-image:
		radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.18) 0, transparent 28%),
		radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.12) 0, transparent 26%),
		linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.06) 50%, transparent 60%);
	pointer-events: none;
}
.cm-legal-hero__glow {
	position: absolute;
	width: 420px;
	height: 420px;
	right: -80px;
	bottom: -160px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	filter: blur(8px);
	pointer-events: none;
}
.cm-legal-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 920px;
	margin: 0 auto;
	text-align: center;
}
.cm-legal-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.28);
	backdrop-filter: blur(10px);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-bottom: 16px;
}
.cm-legal-title {
	margin: 0 0 12px;
	font-size: clamp(1.85rem, 4.5vw, 3rem);
	font-weight: 900;
	letter-spacing: -0.03em;
	line-height: 1.12;
	color: #fff !important;
	text-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}
.cm-legal-sub {
	margin: 0 auto 18px;
	max-width: 640px;
	font-size: clamp(0.98rem, 2vw, 1.12rem);
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.92);
	font-weight: 500;
}
.cm-legal-meta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}
.cm-legal-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.2);
	font-size: 0.82rem;
	font-weight: 700;
}
.cm-legal-badge--soft {
	background: rgba(255, 255, 255, 0.14);
}

/* Layout shell */
.cm-legal-shell {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 28px;
	max-width: 1120px;
	margin: -36px auto 0;
	padding: 0 18px;
	position: relative;
	z-index: 2;
}

/* Sidebar */
.cm-legal-side {
	display: flex;
	flex-direction: column;
	gap: 14px;
	position: sticky;
	top: 88px;
	align-self: start;
}
.cm-legal-side-card {
	background: var(--cm-legal-card);
	border: 1px solid var(--cm-legal-line);
	border-radius: var(--cm-legal-radius);
	padding: 16px;
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
	backdrop-filter: blur(12px);
}
.cm-legal-side-title {
	display: block;
	font-size: 0.72rem;
	font-weight: 900;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cm-legal-muted);
	margin-bottom: 12px;
}
.cm-legal-toc-hint {
	margin: 0;
	font-size: 0.82rem;
	line-height: 1.45;
	color: var(--cm-legal-muted);
}
.cm-legal-toc-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-height: 52vh;
	overflow: auto;
}
.cm-legal-toc-list a {
	display: block;
	padding: 8px 10px;
	border-radius: 10px;
	font-size: 0.84rem;
	font-weight: 700;
	color: #1e293b !important;
	text-decoration: none !important;
	line-height: 1.3;
	transition: background 0.15s ease, color 0.15s ease;
}
.cm-legal-toc-list a:hover {
	background: rgba(79, 70, 229, 0.1);
	color: var(--cm-legal-a1) !important;
}

.cm-legal-related-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border-radius: 12px;
	text-decoration: none !important;
	color: #0f172a !important;
	font-weight: 750;
	font-size: 0.88rem;
	margin-bottom: 6px;
	border: 1px solid transparent;
	transition: all 0.15s ease;
}
.cm-legal-related-link:hover,
.cm-legal-related-link.is-active {
	background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.08));
	border-color: rgba(79, 70, 229, 0.15);
	color: var(--cm-legal-a1) !important;
}
.cm-legal-related-ico {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--cm-legal-grad);
	color: #fff;
	font-size: 0.85rem;
	flex: 0 0 auto;
}

/* Main content card */
.cm-legal-main {
	min-width: 0;
}
.cm-legal-article {
	background: #fff;
	border: 1px solid var(--cm-legal-line);
	border-radius: calc(var(--cm-legal-radius) + 4px);
	padding: clamp(22px, 4vw, 42px);
	box-shadow:
		0 4px 6px rgba(15, 23, 42, 0.03),
		0 24px 50px rgba(15, 23, 42, 0.08);
}

.cm-legal-content {
	font-size: 1.02rem;
	line-height: 1.75;
	color: #1e293b;
}
.cm-legal-content .cm-legal-lead {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 14px;
	border-radius: 12px;
	background: linear-gradient(135deg, #eef2ff, #fdf2f8);
	border: 1px solid rgba(79, 70, 229, 0.12);
	font-size: 0.92rem;
	margin: 0 0 22px;
}
.cm-legal-content > p:first-of-type {
	font-size: 1.08rem;
	color: #334155;
}
.cm-legal-content h2 {
	margin: 2rem 0 0.85rem;
	padding-top: 0.4rem;
	font-size: clamp(1.2rem, 2.4vw, 1.45rem);
	font-weight: 900;
	letter-spacing: -0.02em;
	color: #0f172a;
	scroll-margin-top: 100px;
	position: relative;
}
.cm-legal-content h2::before {
	content: '';
	display: block;
	width: 42px;
	height: 4px;
	border-radius: 999px;
	background: var(--cm-legal-grad);
	margin-bottom: 12px;
}
.cm-legal-content h3 {
	margin: 1.35rem 0 0.55rem;
	font-size: 1.05rem;
	font-weight: 850;
	color: #1e293b;
}
.cm-legal-content p {
	margin: 0 0 1rem;
}
.cm-legal-content ul,
.cm-legal-content ol {
	margin: 0 0 1.15rem;
	padding-left: 1.25rem;
}
.cm-legal-content li {
	margin: 0 0 0.45rem;
}
.cm-legal-content a {
	color: var(--cm-legal-a1) !important;
	font-weight: 750;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.cm-legal-content a:hover {
	color: var(--cm-legal-a2) !important;
}
.cm-legal-content strong {
	color: #0f172a;
	font-weight: 800;
}

/* Bottom related */
.cm-legal-bottom-nav {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-top: 22px;
}
.cm-legal-bottom-card {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 14px;
	border-radius: 16px;
	background: #fff;
	border: 1px solid var(--cm-legal-line);
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
	text-decoration: none !important;
	color: #0f172a !important;
	font-weight: 800;
	font-size: 0.9rem;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.cm-legal-bottom-card i {
	width: 36px;
	height: 36px;
	border-radius: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--cm-legal-grad);
	color: #fff;
	flex: 0 0 auto;
}
.cm-legal-bottom-card:hover {
	transform: translateY(-2px);
	border-color: rgba(79, 70, 229, 0.25);
	box-shadow: 0 16px 40px rgba(79, 70, 229, 0.12);
}

/* Night mode */
html.king-night .cm-legal {
	background:
		radial-gradient(1000px 420px at 10% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
		linear-gradient(180deg, #0b1220 0%, #111827 100%);
	--cm-legal-ink: #e2e8f0;
	--cm-legal-muted: #94a3b8;
	--cm-legal-line: rgba(148, 163, 184, 0.14);
	--cm-legal-card: rgba(15, 23, 42, 0.72);
}
html.king-night .cm-legal-article {
	background: #0f172a;
	border-color: rgba(148, 163, 184, 0.12);
}
html.king-night .cm-legal-content,
html.king-night .cm-legal-content h2,
html.king-night .cm-legal-content h3,
html.king-night .cm-legal-content strong,
html.king-night .cm-legal-toc-list a,
html.king-night .cm-legal-related-link,
html.king-night .cm-legal-bottom-card {
	color: #e2e8f0 !important;
}
html.king-night .cm-legal-content > p:first-of-type,
html.king-night .cm-legal-content p {
	color: #cbd5e1;
}
html.king-night .cm-legal-bottom-card,
html.king-night .cm-legal-side-card {
	background: rgba(15, 23, 42, 0.9);
}

/* Responsive */
@media (max-width: 920px) {
	.cm-legal-shell {
		grid-template-columns: 1fr;
		margin-top: -28px;
	}
	.cm-legal-side {
		position: static;
		order: 2;
	}
	.cm-legal-main {
		order: 1;
	}
	.cm-legal-bottom-nav {
		grid-template-columns: 1fr;
	}
	.cm-legal-hero {
		padding: 36px 16px 48px;
		border-bottom-left-radius: 24px;
		border-bottom-right-radius: 24px;
	}
}
@media (max-width: 520px) {
	.cm-legal-article {
		padding: 18px 16px;
		border-radius: 18px;
	}
	.cm-legal-content {
		font-size: 0.98rem;
	}
}
