/* ═══════════════════════════════════════════════════════
   Fort Aegis — Terms of Service Page Styles
   ═══════════════════════════════════════════════════════ */

/* ── Pure-CSS safety reveal ── */
@keyframes reveal-body-tos   { to { opacity: 1; } }
@keyframes reveal-container   { to { visibility: visible; } }

body {
  align-items: flex-start;
  justify-content: flex-start;
  padding: calc(64px + clamp(2rem, 4vw, 4rem)) 1rem clamp(2rem, 4vw, 4rem);
  animation: reveal-body-tos 0.5s ease 2.5s both;
}

body.loaded {
  animation: none;
  opacity: 1;
}

body.loaded .container {
  visibility: visible;
  animation: none;
}

.container {
  width: min(100%, 860px);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  visibility: hidden;
  animation: reveal-container 0s linear 2.8s both;
}

/* ── Page Header ── */
.page-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  width: 64px;
  height: auto;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 20px rgba(110, 159, 255, 0.5))
          drop-shadow(0 0 40px rgba(110, 159, 255, 0.2));
  animation: float 5s ease-in-out infinite;
}

.logo-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px dashed rgba(110, 159, 255, 0.2);
  animation: orbit-spin 25s linear infinite;
}

.logo-ring--reverse {
  inset: -14px;
  border-style: dotted;
  border-color: rgba(110, 159, 255, 0.1);
  animation-direction: reverse;
  animation-duration: 35s;
}

@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.logo-glow-orb {
  position: absolute;
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(110, 159, 255, 0.12) 0%,
    rgba(110, 159, 255, 0.04) 40%,
    transparent 70%);
  animation: glow-breathe 4s ease-in-out infinite;
  z-index: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.page-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 0.6rem;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: 52ch;
  margin: 0 auto;
}

.header-divider {
  width: 60px;
  height: 2px;
  margin: 1.4rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.tos-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 2rem;
  justify-content: center;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.tos-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tos-meta strong {
  color: var(--text-soft);
  font-weight: 600;
}

/* ── Table of Contents ── */
.tos-toc {
  padding: clamp(1.2rem, 2.5vw, 2rem);
  margin-bottom: 1.5rem;
}

.tos-toc h2 {
  font-size: 1rem;
  color: var(--accent-light);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--surface-border);
}

.toc-list {
  list-style: none;
  counter-reset: toc-counter;
  padding: 0;
}

.toc-list li {
  counter-increment: toc-counter;
}

.toc-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  margin: 0.15rem 0;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.toc-list a::before {
  content: counter(toc-counter) ".";
  font-weight: 700;
  color: var(--accent);
  font-size: 0.82rem;
  min-width: 1.6rem;
}

.toc-list a:hover {
  background: rgba(110, 159, 255, 0.08);
  color: var(--accent-light);
}

/* ── TOS Sections ── */
.tos-body {
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.tos-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 80px;
}

.tos-section:last-child {
  margin-bottom: 0;
}

.tos-section h2 {
  font-size: 1.2rem;
  color: var(--accent-light);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--surface-border);
}

.tos-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 1.2rem 0 0.5rem;
}

.tos-section p {
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.75;
  margin-bottom: 0.6rem;
}

.tos-section p:last-child {
  margin-bottom: 0;
}

/* Definition list (Section 1) */
.tos-definitions {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.tos-definitions li {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(162, 200, 255, 0.06);
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}

.tos-definitions li:last-child {
  border-bottom: none;
}

.tos-def-term {
  color: var(--accent);
  font-weight: 600;
}

/* ── Critical Warning Callout ── */
.tos-critical {
  margin: 1.5rem 0;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-md);
  background: rgba(255, 138, 138, 0.06);
  border: 1px solid rgba(255, 138, 138, 0.25);
  box-shadow: 0 0 24px rgba(255, 138, 138, 0.06);
}

.tos-critical-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--danger);
  margin-bottom: 0.6rem;
}

.tos-critical p {
  color: var(--danger);
  font-weight: 600;
}

/* ── Legal Disclaimer Block (ALL CAPS sections) ── */
.tos-disclaimer {
  margin: 0.8rem 0;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  background: rgba(110, 159, 255, 0.04);
  border: 1px solid var(--surface-border);
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

/* ── Final Acknowledgment ── */
.tos-acknowledgment {
  margin-top: 2.5rem;
  padding: 1.4rem 1.6rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(110, 159, 255, 0.08), rgba(110, 159, 255, 0.02));
  border: 1px solid rgba(110, 159, 255, 0.2);
}

.tos-acknowledgment p {
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
}

/* ── Privacy Policy meta row ── */
.pp-meta {
  margin-bottom: 1.2rem;
  justify-content: flex-start;
}

/* ── Document Tab Bar ── */
.legal-tab-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 0;
}

.legal-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.2rem;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  letter-spacing: 0.02em;
  position: relative;
  bottom: -1px;
}

.legal-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.legal-tab:hover {
  color: var(--accent-light);
  background: rgba(110, 159, 255, 0.06);
}

.legal-tab--active {
  color: var(--accent-light);
  background: rgba(110, 159, 255, 0.06);
  border-color: var(--surface-border);
  border-bottom-color: transparent;
}

.legal-tab--active::after {
  content: '';
  position: absolute;
  inset: 0;
  bottom: -1px;
  background: var(--bg-0);
  z-index: -1;
  border-radius: inherit;
}

.legal-tab--active svg {
  opacity: 1;
}

/* ── Document Panels ── */
.legal-panel {
  display: block;
}

.legal-panel[hidden] {
  display: none;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .logo-wrap {
    width: 80px;
    height: 80px;
  }
  .logo {
    width: 50px;
  }
  .tos-body {
    padding: 1.2rem;
  }
  .tos-toc {
    padding: 1.2rem;
  }
  .legal-tab {
    padding: 0.55rem 0.8rem;
    font-size: 0.82rem;
  }
}
