/* ========================================================================
   UrekaTV — Legal pages styles (shared by terms, privacy, faq)
   ======================================================================== */

.legal-hero {
  padding: 120px 0 60px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}
.legal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(50% 60% at 50% 0%, rgba(124, 58, 237, 0.28), transparent 60%),
    radial-gradient(40% 50% at 80% 30%, rgba(236, 72, 153, 0.18), transparent 60%);
}
.legal-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  margin: 16px 0 14px;
}
.legal-hero p {
  color: var(--text-2);
  font-size: 17px;
  max-width: 640px;
  margin: 0 auto;
}
.legal-hero .meta {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.legal {
  padding: 40px 0 96px;
}
.legal__layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  align-items: start;
}
.legal__toc {
  position: sticky;
  top: 88px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.legal__toc h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-bottom: 14px;
  font-weight: 700;
}
.legal__toc ol {
  list-style: none;
  counter-reset: toc;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.legal__toc li {
  counter-increment: toc;
}
.legal__toc a {
  display: block;
  padding: 8px 10px;
  font-size: 13.5px;
  color: var(--text-2);
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.legal__toc a::before {
  content: counter(toc, decimal-leading-zero) ". ";
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}
.legal__toc a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.legal__toc a.is-active {
  background: var(--surface-2);
  color: var(--text);
  border-left-color: var(--brand-2);
}

.legal__content {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}
.legal__content h2 {
  font-size: 26px;
  margin: 56px 0 14px;
  scroll-margin-top: 88px;
}
.legal__content h2:first-child { margin-top: 0; }
.legal__content h3 {
  font-size: 18px;
  margin: 28px 0 10px;
  color: var(--text);
  font-weight: 700;
}
.legal__content p {
  color: var(--text-2);
  margin: 0 0 14px;
}
.legal__content ul,
.legal__content ol {
  color: var(--text-2);
  padding-left: 22px;
  margin: 0 0 18px;
}
.legal__content li { margin-bottom: 8px; }
.legal__content strong { color: var(--text); }
.legal__content a { color: var(--brand-2); text-decoration: underline; text-underline-offset: 3px; }
.legal__content a:hover { color: #fff; }
.legal__content code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 13.5px;
}

.legal__content blockquote {
  margin: 20px 0;
  padding: 18px 22px;
  background: var(--surface);
  border-left: 3px solid var(--brand-2);
  border-radius: 12px;
  color: var(--text-2);
  font-size: 15px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.legal-table th,
.legal-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.legal-table thead th {
  background: var(--surface-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  font-weight: 700;
}
.legal-table tbody tr:last-child td { border-bottom: 0; }
.legal-table tbody tr:hover { background: var(--surface-2); }
.legal-table td:first-child { font-weight: 600; color: var(--text); width: 30%; }

.legal__footer {
  margin-top: 64px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.legal__footer p {
  color: var(--text-2);
  font-size: 14.5px;
  margin: 0;
}

/* ---------- FAQ page (extends home FAQ) ---------- */
.faq-page {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  align-items: start;
}
.faq-cats {
  position: sticky;
  top: 88px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.faq-cats h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-bottom: 14px;
  font-weight: 700;
}
.faq-cats a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-2);
  border-radius: 8px;
  margin-bottom: 2px;
}
.faq-cats a span {
  font-size: 12px;
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--text-3);
}
.faq-cats a:hover,
.faq-cats a.is-active {
  background: var(--surface-2);
  color: var(--text);
}

.faq-search {
  position: relative;
  margin-bottom: 28px;
}
.faq-search input {
  width: 100%;
  padding: 16px 20px 16px 50px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.faq-search input::placeholder { color: var(--text-3); }
.faq-search input:focus {
  outline: none;
  border-color: var(--brand-2);
  background: var(--surface-2);
}
.faq-search::before {
  content: "🔍";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.6;
}

.faq-section h2 {
  font-size: 22px;
  margin: 36px 0 16px;
  scroll-margin-top: 88px;
}
.faq-section:first-child h2 { margin-top: 0; }
.faq-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
  display: none;
}
.faq-empty.is-visible { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .legal__layout,
  .faq-page {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .legal__toc,
  .faq-cats {
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .legal-hero { padding: 90px 0 40px; }
  .legal { padding: 20px 0 64px; }
  .legal__content h2 { font-size: 22px; margin-top: 40px; }
  .legal-table th, .legal-table td { padding: 10px 12px; font-size: 13.5px; }
  .legal-table td:first-child { width: 36%; }
}
