/*
 * Páginas legales (Términos y condiciones). Estático, scope .hg-legal
 * Misma paleta que Libro de Reclamaciones / Hingenia Forms.
 */

.hg-legal {
	--lg-blue: #2563eb;
	--lg-blue-soft: #eff4ff;
	--lg-ink: #0b0b12;
	--lg-text: #374151;
	--lg-muted: #6b7280;
	--lg-border: #e6e7eb;
	--lg-bg: #f6f7f9;
	--lg-surface: #ffffff;
	--lg-amber: #b45309;
	--lg-amber-soft: #fffbeb;
	--lg-red: #dc2626;
	--lg-red-soft: #fef2f2;
	--lg-green: #15803d;
	--lg-green-soft: #f0fdf4;

	background: var(--lg-bg);
	color: var(--lg-text);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	padding-bottom: 80px;
}

/* ---------- Hero ---------- */
.hg-legal-hero {
	background:
		radial-gradient(900px 300px at 85% -40%, rgba(37, 99, 235, 0.16), transparent 70%),
		radial-gradient(600px 260px at 0% 0%, rgba(99, 102, 241, 0.10), transparent 70%),
		var(--lg-surface);
	border-bottom: 1px solid var(--lg-border);
	padding: 56px 16px 40px;
}
.hg-legal-hero__inner { max-width: 1120px; margin: 0 auto; }
.hg-legal-eyebrow {
	display: inline-block;
	font-family: ui-monospace, 'SF Mono', Menlo, monospace;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--lg-blue);
	background: var(--lg-blue-soft);
	padding: 5px 11px;
	border-radius: 999px;
	margin-bottom: 16px;
}
.hg-legal-hero h1 {
	font-family: 'Poppins', 'Inter', sans-serif;
	font-size: clamp(32px, 5vw, 50px);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.05;
	color: var(--lg-ink);
	margin: 0 0 14px;
}
.hg-legal-hero p { font-size: 16px; line-height: 1.6; color: var(--lg-muted); max-width: 680px; margin: 0; }
.hg-legal-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 20px;
	margin-top: 22px;
	font-size: 13px;
	color: var(--lg-muted);
}
.hg-legal-meta b { color: var(--lg-ink); font-weight: 600; }
.hg-legal-print {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--lg-surface);
	border: 1px solid var(--lg-border);
	color: var(--lg-ink);
	font: 600 13px/1 inherit;
	font-family: inherit;
	padding: 8px 12px;
	border-radius: 9px;
	cursor: pointer;
}
.hg-legal-print:hover { border-color: var(--lg-blue); color: var(--lg-blue); }

/* ---------- Layout ---------- */
.hg-legal-layout {
	max-width: 1120px;
	margin: 0 auto;
	padding: 32px 16px 0;
	display: grid;
	grid-template-columns: 270px minmax(0, 1fr);
	gap: 40px;
	align-items: start;
}
@media (max-width: 1023px) {
	.hg-legal-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 20px; }
}

/* Índice */
.hg-legal-toc { position: sticky; top: 96px; }
.hg-legal-toc details {
	background: var(--lg-surface);
	border: 1px solid var(--lg-border);
	border-radius: 14px;
	padding: 14px 10px 10px;
}
.hg-legal-toc summary {
	list-style: none;
	cursor: pointer;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--lg-muted);
	padding: 0 8px 10px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.hg-legal-toc summary::-webkit-details-marker { display: none; }
.hg-legal-toc summary::after { content: '▾'; font-size: 12px; transition: transform 0.2s; }
.hg-legal-toc details:not([open]) summary { padding-bottom: 0; }
.hg-legal-toc details:not([open]) summary::after { transform: rotate(-90deg); }
.hg-legal-toc ol {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: calc(100vh - 190px);
	overflow-y: auto;
	scrollbar-width: thin;
}
.hg-legal-toc a {
	display: flex;
	gap: 6px;
	padding: 6px 8px;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.35;
	color: var(--lg-text);
	text-decoration: none;
	border-left: 2px solid transparent;
	transition: background 0.15s, color 0.15s;
}
.hg-legal-toc a span { color: var(--lg-muted); font-variant-numeric: tabular-nums; min-width: 22px; }
.hg-legal-toc a:hover { background: var(--lg-bg); color: var(--lg-ink); }
.hg-legal-toc a.is-active { background: var(--lg-blue-soft); color: var(--lg-blue); font-weight: 600; border-left-color: var(--lg-blue); }
.hg-legal-toc a.is-active span { color: var(--lg-blue); }
@media (max-width: 1023px) {
	.hg-legal-toc { position: sticky; top: 64px; z-index: 5; }
	.hg-legal-toc details { padding: 12px 10px; box-shadow: 0 8px 24px -16px rgba(15, 23, 42, 0.25); }
	.hg-legal-toc summary { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--lg-ink); }
	.hg-legal-toc details[open] summary { padding-bottom: 10px; }
	.hg-legal-toc ol { max-height: 55vh; }
}

/* ---------- Cuerpo ---------- */
.hg-legal-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hg-legal-section {
	background: var(--lg-surface);
	border: 1px solid var(--lg-border);
	border-radius: 16px;
	padding: 26px 28px;
	scroll-margin-top: 110px;
}
@media (max-width: 640px) {
	.hg-legal-section { padding: 20px 18px; border-radius: 14px; scroll-margin-top: 140px; }
}
.hg-legal-section h2 {
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: 'Poppins', 'Inter', sans-serif;
	font-size: clamp(18px, 2.2vw, 21px);
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.3;
	color: var(--lg-ink);
	margin: 0 0 14px;
}
.hg-legal-num {
	flex: 0 0 34px;
	height: 34px;
	display: inline-grid;
	place-items: center;
	border-radius: 10px;
	background: var(--lg-blue-soft);
	color: var(--lg-blue);
	font-size: 14px;
	font-weight: 800;
	font-family: 'Inter', sans-serif;
	font-variant-numeric: tabular-nums;
}
.hg-legal-section p { font-size: 15px; line-height: 1.75; margin: 0 0 12px; }
.hg-legal-section p:last-child { margin-bottom: 0; }
.hg-legal-section a { color: var(--lg-blue); font-weight: 500; text-decoration: none; }
.hg-legal-section a:hover { text-decoration: underline; }

/* Listas */
.hg-legal-list { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 8px; }
.hg-legal-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.6; }
.hg-legal-list i {
	flex: 0 0 22px;
	height: 22px;
	margin-top: 1px;
	display: inline-grid;
	place-items: center;
	border-radius: 7px;
	font-style: normal;
}
.hg-legal-list--dot i { background: transparent; }
.hg-legal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lg-blue); }
.hg-legal-list--check i { background: var(--lg-green-soft); color: var(--lg-green); }
.hg-legal-list--x i { background: var(--lg-red-soft); color: var(--lg-red); }
@media (min-width: 720px) {
	.hg-legal-list--x, .hg-legal-list--check { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
}

/* Recuadro destacado */
.hg-legal-note {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	background: var(--lg-amber-soft);
	border: 1px solid rgba(180, 83, 9, 0.22);
	border-left: 4px solid #f59e0b;
	border-radius: 12px;
	padding: 14px 16px;
	margin: 4px 0 14px;
	color: var(--lg-amber);
}
.hg-legal-note svg { flex: 0 0 18px; margin-top: 3px; }
.hg-legal-note p { color: #78350f; font-weight: 500; margin: 0 !important; font-size: 14.5px; line-height: 1.6; }

/* Datos de la empresa */
.hg-legal-company { border-color: rgba(37, 99, 235, 0.25); }
.hg-legal-dl {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	margin: 6px 0 18px;
	border: 1px solid var(--lg-border);
	border-radius: 12px;
	overflow: hidden;
}
.hg-legal-dl > div { padding: 11px 14px; border-bottom: 1px solid var(--lg-border); min-width: 0; }
.hg-legal-dl > div:nth-child(odd) { border-right: 1px solid var(--lg-border); }
.hg-legal-dl > div:nth-last-child(-n+2) { border-bottom: 0; }
.hg-legal-dl > div:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
.hg-legal-dl dt { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lg-muted); margin-bottom: 3px; }
.hg-legal-dl dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--lg-ink); word-break: break-word; }
@media (max-width: 640px) {
	.hg-legal-dl { grid-template-columns: minmax(0, 1fr); }
	.hg-legal-dl > div { border-right: 0 !important; border-bottom: 1px solid var(--lg-border) !important; }
	.hg-legal-dl > div:last-child { border-bottom: 0 !important; }
}

/* Contacto */
.hg-legal-contact { border: 1px solid var(--lg-border); border-radius: 14px; overflow: hidden; margin: 6px 0 16px; }
.hg-legal-contact__id { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; background: var(--lg-bg); border-bottom: 1px solid var(--lg-border); }
.hg-legal-contact__id b { color: var(--lg-ink); font-size: 15px; }
.hg-legal-contact__id span { font-size: 13px; color: var(--lg-muted); }
.hg-legal-contact__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .hg-legal-contact__grid { grid-template-columns: minmax(0, 1fr); } }
.hg-legal-chan {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 16px 18px;
	text-decoration: none !important;
	border-right: 1px solid var(--lg-border);
	transition: background 0.15s;
}
.hg-legal-chan:last-child { border-right: 0; }
@media (max-width: 760px) { .hg-legal-chan { border-right: 0; border-bottom: 1px solid var(--lg-border); } .hg-legal-chan:last-child { border-bottom: 0; } }
.hg-legal-chan:hover { background: var(--lg-blue-soft); }
.hg-legal-chan small { font-size: 11.5px; font-weight: 600; color: var(--lg-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.hg-legal-chan b { color: var(--lg-ink); font-size: 14.5px; word-break: break-word; }
.hg-legal-chan--wa:hover { background: var(--lg-green-soft); }
.hg-legal-chan--wa:hover b { color: var(--lg-green); }
.hg-legal-final {
	background: var(--lg-blue-soft);
	border-radius: 12px;
	padding: 14px 16px;
	color: var(--lg-ink) !important;
	font-weight: 600;
}

/* ---------- Dark mode ---------- */
html.dark .hg-legal {
	--lg-ink: #f3f4f6;
	--lg-text: #c9ced6;
	--lg-muted: #9aa1ac;
	--lg-border: rgba(255, 255, 255, 0.08);
	--lg-bg: #080809;
	--lg-surface: #101012;
	--lg-blue: #60a5fa;
	--lg-blue-soft: rgba(37, 99, 235, 0.16);
	--lg-amber-soft: rgba(245, 158, 11, 0.10);
	--lg-red-soft: rgba(220, 38, 38, 0.14);
	--lg-red: #f87171;
	--lg-green-soft: rgba(22, 163, 74, 0.14);
	--lg-green: #4ade80;
}
html.dark .hg-legal-note { border-color: rgba(245, 158, 11, 0.25); color: #fbbf24; }
html.dark .hg-legal-note p { color: #fde68a; }

/* ---------- Impresión ---------- */
@media print {
	header.site-header, #site-header, footer, .hg-legal-toc, .hg-legal-print, .hgf-wa-float, [class*="whatsapp"] { display: none !important; }
	.hg-legal { background: #fff; padding: 0; }
	.hg-legal-hero { background: none; padding: 0 0 16px; }
	.hg-legal-layout { display: block; padding: 0; }
	.hg-legal-section { border: 0; padding: 12px 0; break-inside: avoid-page; }
	.hg-legal-section a { color: #000; }
}
