/* ═══════════════════════════════════════════════════════════════
   Akulichev Calls — Legal Pages (Terms, Privacy, Data Policy)
   Dark theme consistent with the Telegram-inspired design system
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-primary:   #0E1621;
  --bg-secondary: #17212B;
  --bg-tertiary:  #1C2A3A;
  --bg-surface:   #182533;
  --accent:       #3390EC;
  --accent-hover: #2B7ED8;
  --accent-light: rgba(51,144,236,0.15);
  --text-primary: #F5F5F5;
  --text-secondary: #8B9BAA;
  --text-tertiary: #6B7C8A;
  --text-accent:  #6AB2F2;
  --border-subtle: rgba(255,255,255,0.06);
  --border-light:  rgba(255,255,255,0.1);
  --danger:       #E5533B;
  --font-family: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-family);
  font-optical-sizing: auto;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

a { color: var(--text-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ──────────────────────────────────────────────── */
.legal-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ──────────────────────────────────────────────── */
.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
}

.legal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legal-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 200ms;
}
.legal-back-btn:hover { background: var(--bg-tertiary); }
.legal-back-btn svg { width: 20px; height: 20px; }

.legal-header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legal-header-subtitle {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-tertiary);
}

.legal-header-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legal-header-name span:first-child {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(51,144,236,0.25);
  background: var(--accent-light);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-accent);
}

.legal-header-date {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ─── Main Content ────────────────────────────────────────── */
.legal-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.legal-card {
  width: 100%;
  max-width: 840px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: calc(100dvh - 100px);
}

/* ─── Card Header ─────────────────────────────────────────── */
.legal-card h1 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.legal-card .legal-intro {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.legal-card .legal-intro strong {
  color: var(--text-primary);
}

.legal-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--accent-light);
  border: 1px solid rgba(51,144,236,0.2);
  font-size: 12px;
  color: var(--text-accent);
  line-height: 1.5;
}
.legal-notice-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(51,144,236,0.25);
}

/* ─── Scrollable Body ─────────────────────────────────────── */
.legal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.legal-body:hover {
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.legal-body::-webkit-scrollbar { width: 5px; }
.legal-body::-webkit-scrollbar-track { background: transparent; }
.legal-body::-webkit-scrollbar-thumb { background: transparent; border-radius: 10px; }
.legal-body:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

.legal-body strong {
  color: var(--text-primary);
}

.legal-body p { margin-bottom: 8px; }

/* ─── Sections ────────────────────────────────────────────── */
.legal-section {
  margin-bottom: 28px;
}
.legal-section:last-child { margin-bottom: 0; }

.legal-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 9999px;
  background: var(--accent-light);
  border: 1px solid rgba(51,144,236,0.2);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-accent);
}

.legal-section ul {
  list-style: disc;
  padding-left: 20px;
  margin: 6px 0 8px;
}
.legal-section ul li {
  margin-bottom: 4px;
}

.legal-section .danger-text {
  color: var(--danger);
}

/* ─── Footer ──────────────────────────────────────────────── */
.legal-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.legal-footer-copy {
  font-size: 12px;
  color: var(--text-tertiary);
}
.legal-footer-copy strong {
  font-weight: 600;
  color: var(--text-secondary);
}

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
}
.legal-footer-links a {
  color: var(--text-tertiary);
  transition: color 200ms;
}
.legal-footer-links a:hover {
  color: var(--text-accent);
}
.legal-footer-links .dot {
  color: var(--text-tertiary);
  opacity: 0.4;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (min-width: 640px) {
  .legal-header { padding: 12px 24px; }
  .legal-card { padding: 32px; }
  .legal-card h1 { font-size: 22px; }
  .legal-header-date-mobile { display: none; }
}

@media (max-width: 639px) {
  .legal-main { padding: 8px; }
  .legal-card {
    border-radius: 12px;
    padding: 16px;
    max-height: calc(100dvh - 80px);
  }
  .legal-header-date-desktop { display: none; }
}

@media (max-width: 480px) {
  .legal-main { padding: 0; }
  .legal-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    max-height: calc(100dvh - 60px);
  }
}
