/* ============================================
   Dakzhou Theme - Legal pages
   Used by the Terms of Service page template.
   ============================================ */

.dz-legal-page {
  background: var(--bg-soft);
  color: var(--ink);
}

.dz-legal-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 96px;
  background:
    radial-gradient(circle at 82% 18%, rgba(16, 185, 129, .28), transparent 32%),
    radial-gradient(circle at 12% 86%, rgba(249, 115, 22, .18), transparent 34%),
    linear-gradient(135deg, #0f2d25 0%, #164e3f 56%, #0f766e 100%);
  color: #fff;
}

.dz-legal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: linear-gradient(rgba(255,255,255,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.1) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 90%);
}

.dz-legal-hero .container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
}

.dz-legal-eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  padding: 7px 13px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.1);
  color: #d1fae5;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.dz-legal-hero h1 {
  max-width: 820px;
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(2.25rem, 5vw, 3.5rem) !important;
  letter-spacing: -.035em;
  line-height: 1.06 !important;
}

.dz-legal-lead {
  max-width: 720px;
  margin: 0 0 24px;
  color: rgba(255,255,255,.78);
  font-size: 1.03rem;
  line-height: 1.75;
}

.dz-legal-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.66);
  font-size: .82rem;
}

.dz-legal-meta span::after {
  content: "·";
  margin-left: 8px;
}

.dz-legal-main {
  position: relative;
  z-index: 2;
  margin-top: -48px;
  padding-bottom: 84px;
}

.dz-legal-layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  max-width: 1100px;
}

.dz-legal-sidebar {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dz-legal-nav,
.dz-legal-help {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.dz-legal-nav {
  padding: 18px;
}

.dz-legal-nav-title {
  margin: 0 0 8px;
  padding: 0 10px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.dz-legal-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  color: var(--slate);
  font-size: .88rem;
  font-weight: 600;
  transition: background .16s var(--ease), color .16s var(--ease);
}

.dz-legal-nav a:hover {
  background: var(--bg-soft);
  color: var(--emerald-deep);
}

.dz-legal-nav a.is-current {
  background: var(--emerald-light);
  color: var(--emerald-deep);
}

.dz-legal-nav a:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
}

.dz-legal-nav-arrow {
  flex: 0 0 auto;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .16s var(--ease), transform .16s var(--ease);
}

.dz-legal-nav a:hover .dz-legal-nav-arrow,
.dz-legal-nav a.is-current .dz-legal-nav-arrow {
  opacity: 1;
  transform: none;
}

.dz-legal-help {
  padding: 20px;
  background: linear-gradient(155deg, #fff 0%, #f0fdf9 100%);
}

.dz-legal-help-label {
  color: var(--emerald-deep);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.dz-legal-help p {
  margin: 9px 0 12px;
  color: var(--slate);
  font-size: .88rem;
  line-height: 1.55;
}

.dz-legal-help a {
  color: var(--emerald-deep);
  font-size: .86rem;
  font-weight: 700;
}

.dz-legal-help a:hover {
  color: var(--orange-deep);
}

.dz-legal-content {
  min-width: 0;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-pop);
}

.dz-legal-panels {
  min-width: 0;
}

.dz-legal-panel[hidden] {
  display: none !important;
}

.dz-legal-panel {
  outline: none;
}

.dz-legal-panel.dz-policy-enter {
  animation: dzPolicyFade .22s var(--ease) both;
}

.dz-policy-loading {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 600;
}

.dz-policy-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--emerald-border);
  border-top-color: var(--emerald-deep);
  border-radius: 50%;
  animation: dzPolicySpin .7s linear infinite;
}

.dz-legal-empty {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 10px 0;
}

.dz-legal-empty strong {
  color: var(--ink);
  font-size: 1.15rem;
}

.dz-legal-empty p {
  margin: 8px 0 18px;
}

@keyframes dzPolicySpin {
  to { transform: rotate(360deg); }
}

@keyframes dzPolicyFade {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.dz-legal-content > *:first-child {
  margin-top: 0;
}

.dz-legal-content h2,
.dz-legal-content h3,
.dz-legal-content h4 {
  scroll-margin-top: 120px;
}

.dz-legal-content h2 {
  margin: 42px 0 14px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  color: var(--ink);
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  letter-spacing: -.015em;
}

.dz-legal-content h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.dz-legal-content h3 {
  margin: 28px 0 10px;
  color: var(--ink-2);
  font-size: 1.13rem;
}

.dz-legal-content p,
.dz-legal-content li {
  color: var(--slate);
  font-size: .96rem;
  line-height: 1.82;
}

.dz-legal-content p {
  margin: 0 0 16px;
}

.dz-legal-content ul,
.dz-legal-content ol {
  margin: 0 0 20px;
  padding-left: 1.35em;
  list-style: disc;
}

.dz-legal-content ol {
  list-style: decimal;
}

.dz-legal-content li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.dz-legal-content strong {
  color: var(--ink-2);
  font-weight: 700;
}

.dz-legal-content a {
  color: var(--emerald-deep);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(5, 150, 105, .3);
  text-underline-offset: 3px;
}

.dz-legal-content a:hover {
  color: var(--orange-deep);
  text-decoration-color: currentColor;
}

.dz-legal-content .dz-legal-note {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--emerald-border);
  border-left: 4px solid var(--emerald);
  border-radius: var(--radius);
  background: var(--emerald-light);
}

.dz-legal-content .dz-legal-note p:last-child {
  margin-bottom: 0;
}

@media (max-width: 960px) {
  .dz-legal-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .dz-legal-sidebar {
    position: static;
    display: block;
    margin-bottom: 4px;
  }

  .dz-legal-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px;
    scrollbar-width: none;
  }

  .dz-legal-nav::-webkit-scrollbar {
    display: none;
  }

  .dz-legal-nav-title,
  .dz-legal-help {
    display: none;
  }

  .dz-legal-nav a {
    flex: 0 0 auto;
    padding: 9px 12px;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .dz-legal-hero {
    padding: 50px 0 78px;
  }

  .dz-legal-hero h1 {
    font-size: 2.15rem !important;
    line-height: 1.1 !important;
  }

  .dz-legal-lead {
    font-size: .95rem;
  }

  .dz-legal-main {
    margin-top: -36px;
    padding-bottom: 54px;
  }

  .dz-legal-content {
    padding: 26px 21px;
    border-radius: var(--radius-lg);
  }

  .dz-legal-content h2 {
    margin-top: 32px;
    padding-top: 25px;
  }

  .dz-legal-content p,
  .dz-legal-content li {
    font-size: .92rem;
    line-height: 1.75;
  }
}
