/* legal_modal.css — shared across login.html and register.html (unlike
   login.css/register.css, which are deliberately page-specific: this modal's
   markup and behavior are identical on both pages, so it lives once here
   rather than being copy-pasted into each). */

.legal-link-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}
.legal-link-btn:hover,
.legal-link-btn:focus-visible { color: var(--blue); }

.legal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200; /* above the toast stack (1100) and the error popup (1000) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 17, 21, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: legalFadeIn 0.2s ease;
}
.legal-modal-overlay[hidden] { display: none; }

.legal-modal {
  background: var(--paper);
  width: 100%;
  max-width: 560px;
  max-height: min(680px, 85vh);
  border-radius:var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: legalPopIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.legal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.legal-modal-tabs {
  display: flex;
  gap: 4px;
}

.legal-tab {
  border: none;
  background: none;
  padding: 10px 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
}
.legal-tab:hover { color: var(--ink); }
.legal-tab.is-active { color: var(--blue); background: rgba(var(--blue-rgb), 0.12); }

.legal-modal-close {
  border: none;
  background: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
}
.legal-modal-close:hover { background: var(--line); color: var(--ink); }
.legal-modal-close svg { width: 18px; height: 18px; }

.legal-modal-body {
  padding: 20px 28px 28px;
  overflow-y: auto;
}

.legal-panel { display: none; }
.legal-panel.is-active { display: block; }

.legal-panel h2 {
  font-size: 19px;
  margin: 0 0 6px;
  color: var(--ink);
}
.legal-panel h3 {
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: 22px 0 8px;
}
.legal-panel h3:first-of-type { margin-top: 20px; }
.legal-panel p,
.legal-panel li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
}
.legal-panel ul { margin: 0; padding-left: 20px; }
.legal-panel li { margin-bottom: 6px; }

.legal-updated {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0 0 4px;
}

.legal-disclaimer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-soft);
}
.legal-disclaimer a { color: var(--blue); font-weight: 600; }

@keyframes legalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes legalPopIn {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 480px) {
  .legal-modal-header { padding: 8px 8px 8px 14px; }
  .legal-modal-body { padding: 16px 18px 22px; }
  .legal-tab { padding: 8px 10px; font-size: 12.5px; }
}
