/* ===== LEGAL PAGES (Privacy Policy, Terms of Service) ===== */

/* === HEADER === */
.legal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 2rem;
	border-bottom: 1px solid var(--border-light);
	background: var(--bg-primary);
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: var(--blur-backdrop);
	-webkit-backdrop-filter: var(--blur-backdrop);
}

.legal-header-left a {
	color: var(--text-primary);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.95rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	transition: color 0.2s ease;
}

.legal-header-left a:hover {
	color: var(--color-primary);
}

.legal-header-left i {
	font-size: 0.85rem;
}

.legal-header-right {
	display: flex;
	align-items: center;
	gap: 1rem;
}

/* === LANGUAGE SWITCHER === */
.legal-lang-switcher {
	display: flex;
	gap: 0.25rem;
	background: var(--bg-secondary);
	border-radius: 8px;
	padding: 3px;
}

.legal-lang-btn {
	padding: 0.3rem 0.7rem;
	border: none;
	background: transparent;
	color: var(--text-muted);
	font-size: 0.8rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.legal-lang-btn:hover {
	color: var(--text-primary);
}

.legal-lang-btn.active {
	background: var(--bg-primary);
	color: var(--text-primary);
	box-shadow: var(--shadow-xs);
}

/* === MAIN CONTENT === */
.legal-main {
	max-width: 800px;
	margin: 0 auto;
	padding: 3rem 2rem 4rem;
}

.legal-title {
	font-size: clamp(1.8rem, 4vw, 2.5rem);
	font-weight: 800;
	color: var(--text-primary);
	margin-bottom: 0.5rem;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.legal-updated {
	font-size: 0.9rem;
	color: var(--text-muted);
	margin-bottom: 2.5rem;
}

/* === TABLE OF CONTENTS === */
.legal-toc {
	background: var(--bg-secondary);
	border-radius: 12px;
	padding: 1.5rem 2rem;
	margin-bottom: 3rem;
	border: 1px solid var(--border-light);
}

.legal-toc-title {
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--text-muted);
	margin-bottom: 0.75rem;
}

.legal-toc ol {
	list-style: none;
	counter-reset: toc;
	padding: 0;
	margin: 0;
}

.legal-toc li {
	counter-increment: toc;
	margin-bottom: 0.4rem;
}

.legal-toc li::before {
	content: counter(toc) ".";
	font-weight: 600;
	color: var(--color-primary);
	margin-right: 0.5rem;
	font-size: 0.85rem;
}

.legal-toc a {
	color: var(--text-secondary);
	text-decoration: none;
	font-size: 0.9rem;
	transition: color 0.2s ease;
}

.legal-toc a:hover {
	color: var(--color-primary);
}

/* === SECTIONS === */
.legal-section {
	margin-bottom: 2.5rem;
}

.legal-section h2 {
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--text-primary);
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--border-light);
}

.legal-section h3 {
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--text-primary);
	margin: 1.25rem 0 0.5rem;
}

.legal-section p {
	font-size: 0.95rem;
	line-height: 1.7;
	color: var(--text-secondary);
	margin-bottom: 0.75rem;
}

.legal-section ul {
	padding-left: 1.5rem;
	margin-bottom: 0.75rem;
}

.legal-section li {
	font-size: 0.95rem;
	line-height: 1.7;
	color: var(--text-secondary);
	margin-bottom: 0.35rem;
}

.legal-section a {
	color: var(--color-primary);
	text-decoration: none;
}

.legal-section a:hover {
	text-decoration: underline;
}

.legal-section strong {
	color: var(--text-primary);
	font-weight: 600;
}

/* === HIGHLIGHT BOX (for important notices) === */
.legal-highlight {
	background: var(--bg-secondary);
	border-left: 3px solid var(--color-primary);
	border-radius: 0 8px 8px 0;
	padding: 1rem 1.25rem;
	margin: 1rem 0;
}

.legal-highlight p {
	margin-bottom: 0;
}

/* === FOOTER === */
.legal-footer {
	background: var(--bg-secondary);
	border-top: 1px solid var(--border-light);
	padding: 2rem;
	text-align: center;
	color: var(--text-secondary);
}

.legal-footer-links {
	display: flex;
	justify-content: center;
	gap: 1.5rem;
	margin-top: 0.75rem;
	flex-wrap: wrap;
}

.legal-footer-links a {
	color: var(--text-muted);
	text-decoration: none;
	font-size: 0.85rem;
	transition: color 0.2s ease;
}

.legal-footer-links a:hover {
	color: var(--color-primary);
}

.legal-footer-links a:visited {
	color: var(--text-muted);
}

.legal-footer-links a:visited:hover {
	color: var(--color-primary);
}

.legal-footer p {
	font-size: 0.9rem;
	margin: 0;
}

/* === HIDE AUTO-CREATED THEME TOGGLE (conflicts with legal header) === */
.theme-toggle-container {
	display: none !important;
}

/* === INLINE THEME TOGGLE IN HEADER === */
.legal-theme-toggle {
	position: relative;
	width: 44px;
	height: 24px;
	background: var(--bg-tertiary);
	border-radius: 12px;
	cursor: pointer;
	border: none;
	outline: none;
	transition: background 0.2s ease;
	flex-shrink: 0;
}

.legal-theme-toggle::before {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	background: var(--bg-primary);
	border-radius: 50%;
	transition: transform 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .legal-theme-toggle::before {
	transform: translateX(20px);
}

/* === LANGUAGE VISIBILITY === */
.legal-content [data-lang] {
	display: none;
}

.legal-content [data-lang].active {
	display: block;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
	.legal-header {
		padding: 0.75rem 1.25rem;
	}

	.legal-main {
		padding: 2rem 1.25rem 3rem;
	}

	.legal-toc {
		padding: 1.25rem 1.5rem;
	}

	.legal-footer-links {
		gap: 1rem;
	}
}

@media (max-width: 480px) {
	.legal-header {
		padding: 0.75rem 1rem;
		flex-wrap: wrap;
		gap: 0.5rem;
	}

	.legal-main {
		padding: 1.5rem 1rem 2.5rem;
	}

	.legal-title {
		font-size: 1.5rem;
	}

	.legal-toc {
		padding: 1rem 1.25rem;
	}

	.legal-lang-btn {
		padding: 0.25rem 0.5rem;
		font-size: 0.75rem;
	}
}

/* === PRINT === */
@media print {
	.legal-header,
	.legal-footer {
		display: none;
	}

	.legal-main {
		padding: 0;
		max-width: 100%;
	}

	.legal-toc {
		border: 1px solid #ccc;
		background: #f9f9f9;
	}

	.legal-section h2 {
		page-break-after: avoid;
	}

	.legal-content [data-lang] {
		display: block !important;
	}
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
	.legal-header,
	.legal-lang-btn,
	.legal-toc a,
	.legal-section a,
	.legal-footer-links a,
	.legal-header-left a {
		transition: none !important;
	}
}
