/* ==========================================================================
   Terms of Service Styles
   Based on RemotePC design system
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Reset & Base Styles
   -------------------------------------------------------------------------- */
html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* --------------------------------------------------------------------------
   Design Tokens & CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette */
  --bg: #0b0d12;
  --surface: #111523;
  --surface-2: #0f1422;
  --text: #e7ecf7;
  --muted: #9fb0d1;
  --brand: #6ea8ff;
  --brand-2: #82ffd8;
  --accent: #ffaa80;
  --ok: #7dffa7;
  --danger: #ff7d7d;
  
  /* Effects */
  --ring: 0 0 0 8px rgba(110, 168, 255, 0.12);
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45),
            inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* Force dark color scheme */
html { color-scheme: dark; }

/* --------------------------------------------------------------------------
   Base Typography & Body
   -------------------------------------------------------------------------- */
body {
  background: 
    radial-gradient(1200px 800px at 80% -10%, rgba(110, 168, 255, .12), transparent 50%),
    radial-gradient(1000px 700px at -10% 10%, rgba(130, 255, 216, .10), transparent 50%),
    var(--bg);
  
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Inter, 
        "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", 
        "Segoe UI Emoji", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Noise texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("assets/noise.png");
  background-size: 200px 200px;
  opacity: 0.05;
  mix-blend-mode: soft-light;
  z-index: -1;
}

/* --------------------------------------------------------------------------
   Base Elements
   -------------------------------------------------------------------------- */
a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(17, 21, 35, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 24px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.3px;
  color: var(--text);
  text-decoration: none;
}

.brand .logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background:
    radial-gradient(80% 80% at 30% 30%, var(--brand), transparent),
    linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.brand .logo svg {
  width: 18px;
  height: 18px;
  color: white;
}

/* Navigation links */
.navlinks {
  display: flex;
  align-items: center;
  gap: 28px;
}

.navlinks a {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.navlinks a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
  border-radius: 2px;
}

.navlinks a:hover {
  color: var(--text);
}

.navlinks a:hover::after {
  transform: scaleX(1);
}

/* Mobile-only actions */
.mobile-only-actions {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-only-actions a {
  font-size: 14px;
}

/* Desktop-only */
.desktop-only {
  display: inline-flex;
}

/* CTA button */
.cta-primary {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  text-decoration: none;
}

/* Navigation Toggle Button */
.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-toggle-bar {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Main Content Container
   -------------------------------------------------------------------------- */
.legal-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  flex: 1;
}

.section {
  padding: 80px 0;
}

/* --------------------------------------------------------------------------
   Legal Header
   -------------------------------------------------------------------------- */
.legal-header {
  text-align: center;
  margin-bottom: 60px;
  padding-top: 40px;
}

.breadcrumb {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.legal-header h1 {
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.1;
  margin: 20px 0;
  letter-spacing: -0.03em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.legal-header .lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 700px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* Legal Summary Grid */
.legal-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 50px auto 0;
}

@media (max-width: 768px) {
  .legal-summary-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
}

.summary-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.summary-item:hover {
  transform: translateY(-5px);
  border-color: var(--brand);
}

.summary-icon {
  display: block;
  font-size: 32px;
  margin-bottom: 16px;
}

.summary-item strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text);
}

.summary-item span {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Legal Layout
   -------------------------------------------------------------------------- */
.legal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  margin-top: 60px;
}

@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
  }
}

/* Table of Contents */
.legal-toc {
  position: relative;
}

.toc-sticky {
  position: sticky;
  top: 100px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.legal-toc-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 20px;
  opacity: 0.7;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.toc-list a span {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.2s ease;
}

.toc-list a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.toc-list a:hover span {
  color: var(--brand);
}

.toc-list a.active {
  color: var(--text);
  background: rgba(110, 168, 255, 0.1);
}

.toc-list a.active span {
  color: var(--brand);
}

.toc-list a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--brand);
  border-radius: 2px;
}

/* TOC Support Card */
.toc-support-card {
  background: rgba(130, 255, 216, 0.05);
  border: 1px solid rgba(130, 255, 216, 0.1);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}

.toc-support-card p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.toc-support-card a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-2);
  text-decoration: none;
  padding: 8px 16px;
  background: rgba(130, 255, 216, 0.1);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.toc-support-card a:hover {
  background: rgba(130, 255, 216, 0.15);
  transform: translateY(-1px);
}

/* Legal Content */
.legal-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Article Cards */
.legal-content .card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

.legal-content .card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.legal-content .card:hover {
  transform: translateY(-4px);
  border-color: rgba(110, 168, 255, 0.3);
}

.legal-content .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 168, 255, 0.3), transparent);
}

.legal-content h2 {
  font-size: 28px;
  margin: 0 0 20px 0;
  color: var(--text);
}

.legal-content p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 20px 0;
}

.legal-content p:last-child {
  margin-bottom: 0;
}

.legal-content ul {
  color: var(--muted);
  padding-left: 24px;
  margin: 0 0 20px 0;
  line-height: 1.7;
}

.legal-content li {
  margin-bottom: 8px;
}

.legal-content li:last-child {
  margin-bottom: 0;
}

.legal-content li strong {
  color: var(--text);
}

.cookie-link {
  color: var(--brand);
  font-weight: 600;
}

.cookie-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  padding: 80px 0 40px;
  background: linear-gradient(to bottom, transparent, rgba(110, 168, 255, 0.02));
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  filter: blur(1px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 60px;
  margin-bottom: 60px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.footer-brand .brand {
  margin-bottom: 16px;
}

.footer-tagline {
  color: var(--muted);
  font-size: 14px;
  margin: 15px 0 25px;
  max-width: 300px;
  line-height: 1.6;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 6px 12px;
  background: rgba(125, 255, 167, 0.05);
  color: var(--ok);
  border-radius: 99px;
  border: 1px solid rgba(125, 255, 167, 0.1);
}

.status-indicator {
  width: 6px;
  height: 6px;
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--ok);
}

.footer-links-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

@media (max-width: 600px) {
  .footer-links-group {
    grid-template-columns: 1fr;
  }
}

.footer-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 20px;
}

.footer-col a, .cookie-manage-link {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 12px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
  text-align: left;
}

.footer-col a:hover, .cookie-manage-link:hover {
  color: var(--brand);
}

.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 24px 0;
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Cookie Banner
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: calc(100% - 48px);
  max-width: 380px;
  z-index: 10000;
  transform: translateY(150%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.cookie-banner.visible {
  transform: translateY(0);
  pointer-events: auto;
}

.cookie-banner-inner {
  background: rgba(15, 20, 35, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.cookie-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.cookie-header h2 {
  font-size: 16px;
  margin: 0;
  color: #fff;
  letter-spacing: normal;
  text-transform: none;
}

.cookie-icon {
  font-size: 20px;
  animation: cookie-wiggle 4s infinite ease-in-out;
}

.cookie-banner-text p {
  font-size: 14px;
  color: #9fb0d1;
  line-height: 1.5;
  margin: 0 0 12px 0;
}

.cookie-link {
  color: #6ea8ff;
  font-size: 13px;
  text-decoration: none;
  font-weight: 600;
}

.cookie-link:hover {
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-cookie-primary, .btn-cookie-secondary {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-cookie-primary {
  background: linear-gradient(135deg, #6ea8ff, #82ffd8);
  color: #00111a;
}

.btn-cookie-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-cookie-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #e7ecf7;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-cookie-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

@keyframes cookie-wiggle {
  0%, 90% { transform: rotate(0deg); }
  93% { transform: rotate(15deg); }
  96% { transform: rotate(-15deg); }
  100% { transform: rotate(0deg); }
}

/* --------------------------------------------------------------------------
   Animation Classes
   -------------------------------------------------------------------------- */
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .nav-toggle {
    display: flex;
  }
  
  .navlinks {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(-120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
  }
  
  .navlinks.open {
    transform: translateY(0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  }
  
  .mobile-only-actions {
    display: flex;
  }
  
  .desktop-only {
    display: none;
  }
  
  .legal-header h1 {
    font-size: 32px;
    line-height: 1.15;
  }
  
  .legal-header .lead {
    font-size: 16px;
    max-width: unset;
    padding: 0 16px;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 44px 0;
  }
  
  .legal-main {
    padding: 20px 16px 60px;
  }
  
  .legal-header {
    padding-top: 20px;
  }
  
  .legal-content .card {
    padding: 24px;
  }
  
  .legal-content h2 {
    font-size: 22px;
  }
  
  .toc-sticky {
    position: static;
    margin-bottom: 40px;
  }
}

@media (max-width: 480px) {
  .nav {
    padding: 0 16px;
    height: 64px;
  }
  
  .legal-header h1 {
    font-size: 28px;
  }
  
  .legal-content .card {
    padding: 20px;
  }
  
  .summary-item {
    padding: 20px;
  }
  
  .cookie-banner {
    bottom: 16px;
    right: 16px;
    width: calc(100% - 32px);
  }
}

/* --------------------------------------------------------------------------
   Scroll Behavior
   -------------------------------------------------------------------------- */
:target {
  scroll-margin-top: 100px;
}