/* GrowthTools legal modals. Scoped to .gt-legal so it cannot affect the page layout. */

html.gt-legal-open,
html.gt-legal-open body {
  overflow: hidden;
}

.gt-legal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  background: transparent;
  color: #131314;
  font-family: Figtree, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.gt-legal[open] {
  display: flex;
}

.gt-legal::backdrop {
  background: rgba(19, 19, 20, 0.58);
  backdrop-filter: blur(6px);
}

.gt-legal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-height: min(90vh, 940px);
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8e8e9;
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(19, 19, 20, 0.28);
}

.gt-legal[open] .gt-legal-panel {
  animation: gt-legal-in 180ms ease-out both;
}

@keyframes gt-legal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gt-legal-head {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 26px 32px 20px;
  border-bottom: 1px solid #e8e8e9;
  background: #fff;
}

.gt-legal-kicker {
  margin: 0 0 7px;
  color: #46474e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.gt-legal-title {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.gt-legal-updated {
  margin: 9px 0 0;
  color: #46474e;
  font-size: 13px;
}

.gt-legal-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0 0 2px;
  border: 1px solid #e8e8e9;
  border-radius: 999px;
  background: #fff;
  color: #131314;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.gt-legal-close:hover {
  border-color: #131314;
  background: #131314;
  color: #fff;
}

.gt-legal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 32px 36px;
}

.gt-legal-body p,
.gt-legal-body li {
  color: #2f3036;
  font-size: 0.95rem;
  line-height: 1.68;
}

.gt-legal-body p {
  margin: 11px 0;
}

.gt-legal-body h3 {
  margin: 30px 0 10px;
  color: #131314;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.gt-legal-body h4 {
  margin: 22px 0 8px;
  color: #131314;
  font-size: 0.97rem;
  font-weight: 700;
}

.gt-legal-body ul {
  margin: 10px 0 14px;
  padding-left: 20px;
}

.gt-legal-body li {
  margin: 6px 0;
}

.gt-legal-body a {
  color: #131314;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gt-legal-body strong {
  color: #131314;
  font-weight: 600;
}

.gt-legal-intro {
  margin-top: 18px !important;
  color: #131314 !important;
  font-size: 1rem !important;
}

.gt-legal-note {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #e8e8e9;
  border-left: 3px solid #d5ff41;
  border-radius: 10px;
  background: #fafafa;
}

.gt-legal-scroll {
  width: 100%;
  margin: 12px 0 20px;
  overflow-x: auto;
}

.gt-legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.gt-legal-table th,
.gt-legal-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e8e8e9;
  text-align: left;
  vertical-align: top;
}

.gt-legal-table th {
  color: #131314;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gt-legal-table td {
  color: #2f3036;
  line-height: 1.5;
}

.gt-legal-contact {
  margin-top: 30px !important;
  padding-top: 18px;
  border-top: 1px solid #e8e8e9;
}

/* Footer triggers, styled like the existing footer links. */
footer nav .foot-legal {
  display: block;
  width: 100%;
  margin: 0;
  padding: 5px 0;
  border: 0;
  background: none;
  color: var(--muted, #46474e);
  font-family: inherit;
  font-size: 15px;
  font-weight: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}

footer nav .foot-legal:hover {
  color: var(--ink, #131314);
}

@media (max-width: 640px) {
  .gt-legal {
    align-items: stretch;
    padding: 0;
  }

  .gt-legal-panel {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border: 0;
    border-radius: 0;
  }

  .gt-legal-head {
    padding: 20px 20px 16px;
  }

  .gt-legal-body {
    padding: 4px 20px 30px;
  }

  .gt-legal-close {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gt-legal[open] .gt-legal-panel {
    animation: none;
  }
}
