@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap');

/* ===================================
  GymTracker - Design System
   Automatic Dark/Light Theme
=================================== */
:root,
html[data-theme="dark"] {
  --bg:             #0A0A0C;
  --bg-card:        #1C1C1E;
  --bg-elevated:    #2C2C2E;
  --text:           #FFFFFF;
  --text-secondary: rgba(235,235,245,0.75);
  --text-muted:     #8E8E93;
  --accent:         #0A84FF;
  --success:        #34C759;
  --error:          #FF3B30;
  --warning:        #FF9500;
  --premium:        #BF5AF2;
  --premium2:       #8B2CDE;
  --separator:      rgba(84,84,88,0.6);

  --gradient-premium: linear-gradient(135deg, #BF5AF2 0%, #8B2CDE 100%);
  --gradient-accent:  linear-gradient(135deg, #0A84FF 0%, #5856D6 100%);
  --gradient-hero:    linear-gradient(160deg, #111113 0%, #1a0a2e 60%, #0a1a2e 100%);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(191,90,242,0.25);
}

/* Light Mode Theme */
html[data-theme="light"] {
  --bg:             #FFFFFF;
  --bg-card:        #F5F5F7;
  --bg-elevated:    #EBEBF0;
  --text:           #1C1C1E;
  --text-secondary: rgba(28,28,30,0.72);
  --text-muted:     #79869C;
  --accent:         #0A84FF;
  --success:        #34C759;
  --error:          #FF3B30;
  --warning:        #FF9500;
  --premium:        #9D4EDD;
  --premium2:       #7209B7;
  --separator:      rgba(0,0,0,0.08);

  --gradient-premium: linear-gradient(135deg, #9D4EDD 0%, #7209B7 100%);
  --gradient-accent:  linear-gradient(135deg, #0A84FF 0%, #3C3AA1 100%);
  --gradient-hero:    linear-gradient(160deg, #FFFFFF 0%, #F5F3FF 60%, #E8E3FF 100%);
}

/* System preference fallback */
@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    --bg:             #FFFFFF;
    --bg-card:        #F5F5F7;
    --bg-elevated:    #EBEBF0;
    --text:           #1C1C1E;
    --text-secondary: rgba(28,28,30,0.72);
    --text-muted:     #79869C;
    --accent:         #0A84FF;
    --success:        #34C759;
    --error:          #FF3B30;
    --warning:        #FF9500;
    --premium:        #9D4EDD;
    --premium2:       #7209B7;
    --separator:      rgba(0,0,0,0.08);

    --gradient-premium: linear-gradient(135deg, #9D4EDD 0%, #7209B7 100%);
    --gradient-accent:  linear-gradient(135deg, #0A84FF 0%, #3C3AA1 100%);
    --gradient-hero:    linear-gradient(160deg, #FFFFFF 0%, #F5F3FF 60%, #E8E3FF 100%);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; color-scheme: light dark; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .nav-brand span, .section-label, .section-title, .hero-badge {
  font-family: 'Sora', 'Manrope', sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.8; }

/* Global focus-visible ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ── Nav ── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 64px;
  background: rgba(10,10,12,0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--separator);
}

/* Light mode nav */
html[data-theme="light"] .site-nav {
  background: rgba(255,255,255,0.85);
}

.nav-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.nav-brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-brand span { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-size: 15px; color: var(--text-secondary); font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: var(--gradient-premium);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 600 !important;
  font-size: 14px !important;
  transition: opacity .2s, transform .2s;
}
.nav-cta:hover { opacity: 0.9 !important; transform: scale(1.02); }
.nav-cta:focus-visible { outline-color: #fff; }

/* ── Site Language Switch ── */
html.lang-en [data-lang="it"] { display: none; }
html.lang-it [data-lang="en"] { display: none; }
.lang-switch {
  display: flex; align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: 20px; padding: 3px;
}
.lang-switch-btn {
  padding: 4px 10px; border-radius: 14px; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  background: none; border: none; transition: all .15s;
  font-family: 'Manrope', sans-serif; letter-spacing: 0.3px;
}
.lang-switch-btn.active { background: rgba(255,255,255,0.12); color: var(--text); }

/* Light mode language switch */
html[data-theme="light"] .lang-switch-btn.active { background: rgba(0,0,0,0.12); }

/* ── Hero ── */
.hero {
  min-height: 100svh;
  background: var(--gradient-hero);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative; overflow: hidden;
  width: 100%;
  max-width: none;
  margin: 0;
}
.hero::before {
  content: '';
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(191,90,242,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-brand {
  font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 20px;
}
.app-icon-hero {
  width: 110px; height: 110px; border-radius: 26px;
  box-shadow: var(--shadow-glow), 0 8px 40px rgba(0,0,0,0.6);
  margin-bottom: 28px;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}
.hero h1 {
  font-size: clamp(52px, 10vw, 88px);
  font-weight: 800;
  letter-spacing: -3px;
  line-height: 1;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 10%, rgba(191,90,242,0.95) 55%, rgba(10,132,255,0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Light mode hero title - solid black */
html[data-theme="light"] .hero h1 {
  background: none;
  -webkit-text-fill-color: unset;
  color: #1C1C1E;
}
.hero-tagline {
  font-size: clamp(17px, 2.8vw, 24px);
  font-weight: 700;
  font-family: 'Sora', 'Manrope', sans-serif;
  color: var(--text-secondary);
  letter-spacing: -0.4px;
  margin-bottom: 20px;
  line-height: 1.25;
}
.hero-sub {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 40px;
  line-height: 1.65;
}
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--gradient-premium);
  color: #fff; font-weight: 700; font-size: 17px;
  padding: 16px 32px; border-radius: var(--radius-xl);
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 24px rgba(191,90,242,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(191,90,242,0.5); color: #fff; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  color: var(--text); font-weight: 600; font-size: 17px;
  padding: 16px 32px; border-radius: var(--radius-xl);
  transition: transform .2s, background .2s;
}
.btn-secondary:hover { transform: translateY(-2px); background: #3A3A3C; color: var(--text); }

/* ── Stats Bar ── */
.stats-bar {
  background: var(--bg-card);
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
}
.stats-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 28px 24px;
  display: flex; flex-wrap: wrap; gap: 32px;
  justify-content: center; text-align: center;
}
.stat-item {}
.stat-value {
  font-size: 28px; font-weight: 800; letter-spacing: -0.5px;
  line-height: 1;
}
.stat-label {
  font-size: 12px; color: var(--text-muted); margin-top: 6px;
  letter-spacing: 0.3px;
}
.grad-premium {
  background: var(--gradient-premium);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.grad-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Sections ── */
section:not(.hero) { padding: 100px 24px; max-width: 1100px; margin: 0 auto; scroll-margin-top: 72px; }
.screenshots-section { scroll-margin-top: 72px; }
.section-label {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--premium); text-transform: uppercase;
  margin-bottom: 8px;
}
.section-title {
  font-size: clamp(26px, 4.5vw, 44px);
  font-weight: 800; letter-spacing: -1px; line-height: 1.1;
  margin-bottom: 16px;
}
.section-sub {
  font-size: 16px; color: var(--text-secondary);
  max-width: 520px; margin-bottom: 56px; line-height: 1.65;
}

/* ── Features Grid ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(191,90,242,0.3);
  box-shadow: 0 8px 32px rgba(191,90,242,0.1);
}
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: inherit;
}
.feature-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 15px; color: var(--text-secondary); line-height: 1.65; }

/* Feature icon colors */
.icon-purple { background: rgba(191,90,242,0.15); color: #BF5AF2; }
.icon-blue   { background: rgba(10,132,255,0.15);  color: #0A84FF; }
.icon-green  { background: rgba(52,199,89,0.15);   color: #34C759; }
.icon-orange { background: rgba(255,149,0,0.15);   color: #FF9500; }
.icon-red    { background: rgba(255,59,48,0.15);   color: #FF3B30; }
.icon-indigo { background: rgba(88,86,214,0.15);   color: #5856D6; }
.icon-pink   { background: rgba(255,45,85,0.15);   color: #FF2D55; }
.icon-cyan   { background: rgba(50,173,230,0.15);  color: #32ADE6; }

/* ── Screenshots ── */
.screenshots-section { background: linear-gradient(180deg, var(--bg) 0%, #0f0520 50%, var(--bg) 100%); }
.screenshots-header { max-width: 1100px; margin: 0 auto; padding: 100px 24px 56px; }
.screenshots-carousel { max-width: 1240px; margin: 0 auto; padding: 0 24px 100px; }
.screenshots-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.screenshots-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 320px);
  gap: 20px; overflow-x: auto; overflow-y: hidden;
  padding: 20px 8px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 8px;
  overscroll-behavior-x: contain;
  width: 100%;
  flex: 1 1 auto;
}
.screenshots-scroll::-webkit-scrollbar { display: none; }
.screenshot-item {
  min-width: 0; scroll-snap-align: center;
}
.screenshot-item picture {
  display: block;
}
.screenshot-item img {
  width: 100%; height: auto; max-height: 560px;
  display: block;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform .3s;
}
.screenshot-item img:hover { transform: scale(1.02); }
.carousel-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(28,28,30,0.88);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: transform .2s, background .2s, opacity .2s;
}
.carousel-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(58,58,60,0.96);
}
.carousel-button:disabled {
  opacity: 0.35;
  cursor: default;
}
.screenshot-label {
  text-align: center; margin-top: 12px;
  font-size: 13px; color: var(--text-muted); font-weight: 500;
}

/* ── Contact Section ── */
.contact-card {
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: var(--radius-xl);
  padding: 64px 48px;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

/* ── Pro Section ── */
.pro-card {
  background: linear-gradient(160deg, rgba(191,90,242,0.18) 0%, rgba(10,132,255,0.08) 100%);
  border: 1px solid rgba(191,90,242,0.35);
  border-radius: var(--radius-xl);
  padding: 64px 48px;
  text-align: center;
  position: relative; overflow: hidden;
}
.pro-card::before {
  content: '';
  position: absolute; top: -120px; right: -120px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(191,90,242,0.12) 0%, transparent 65%);
  pointer-events: none;
}
.pro-top { margin-bottom: 40px; }
.pro-icon { width: 60px; height: 60px; border-radius: 14px; margin-bottom: 14px; display: block; margin-left: auto; margin-right: auto; }
.pro-price-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px 28px;
  margin-top: 24px;
}
.pro-price-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--premium);
}
.pro-price-sub {
  font-size: 14px;
  color: var(--text-muted);
}
.pro-list {
  list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin: 32px 0;
}
.pro-list li {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; color: var(--text-secondary);
}
.pro-list li::before { content: '✓'; color: var(--success); font-weight: 700; }

/* ── Pro comparison table ── */
.pro-compare-table {
  width: 100%; border-collapse: collapse; margin: 32px 0;
  border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(191,90,242,0.2);
}
.pro-compare-header,
.pro-compare-row {
  display: grid;
  grid-template-columns: 1fr 90px 90px;
  align-items: center;
}
.pro-compare-header {
  background: rgba(191,90,242,0.12);
  padding: 10px 16px;
}
.pro-compare-header .pro-compare-feature { font-size: 12px; color: var(--text-muted); }
.pro-compare-header .free-col { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-align: center; }
.pro-compare-header .pro-col { font-size: 13px; font-weight: 700; color: var(--premium); text-align: center; }
.pro-compare-row {
  padding: 11px 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.pro-compare-row:nth-child(odd) { background: rgba(255,255,255,0.02); }
.pro-compare-feature { font-size: 14px; color: var(--text-secondary); text-align: left; }
.pro-compare-col { font-size: 14px; font-weight: 600; text-align: center; color: var(--text-primary); }
.compare-yes { color: var(--success); font-size: 16px; }
.compare-no { color: var(--text-muted); font-size: 14px; }

/* ── Tabs (language) ── */
.lang-tabs { display: flex; gap: 4px; margin-bottom: 32px; }
.lang-tab {
  padding: 8px 20px; border-radius: 20px; cursor: pointer;
  font-size: 14px; font-weight: 600;
  background: var(--bg-elevated); color: var(--text-muted);
  border: 1px solid transparent;
  transition: all .2s;
}
.lang-tab.active {
  background: rgba(10,132,255,0.15);
  border-color: var(--accent); color: var(--accent);
}
.lang-content { display: none; }
.lang-content.active { display: block; }

/* ── Legal pages ── */
.legal-hero {
  padding: 120px 24px 60px;
  background: linear-gradient(160deg, #111113 0%, #1a1a2e 100%);
  text-align: center;
}
.legal-hero .section-label { display: block; margin-bottom: 12px; }
.legal-hero h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 800; letter-spacing: -1px; }
.legal-hero p { color: var(--text-secondary); margin-top: 12px; font-size: 15px; }
.legal-content { max-width: 800px; margin: 0 auto; padding: 60px 24px 100px; }
.legal-section { margin-bottom: 48px; }
.legal-section h2 {
  font-size: 22px; font-weight: 700; margin-bottom: 16px;
  color: var(--text);
}
.legal-section h3 { font-size: 17px; font-weight: 600; margin: 20px 0 10px; color: var(--text-secondary); }
.legal-section p { font-size: 15px; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.7; }
.legal-section ul { list-style: none; padding-left: 0; }
.legal-section ul li {
  font-size: 15px; color: var(--text-secondary);
  padding: 6px 0 6px 20px; position: relative; line-height: 1.6;
}
.legal-section ul li::before { content: '•'; position: absolute; left: 0; color: var(--premium); }
.highlight-box {
  background: rgba(10,132,255,0.1);
  border: 1px solid rgba(10,132,255,0.2);
  border-radius: var(--radius-md);
  padding: 20px 24px; margin: 20px 0;
}
.highlight-box p { color: var(--text); margin: 0; }
.warning-box {
  background: rgba(255,149,0,0.1);
  border: 1px solid rgba(255,149,0,0.25);
  border-radius: var(--radius-md);
  padding: 20px 24px; margin: 20px 0;
}
.warning-box p { color: #FF9500; margin: 0; }
.contact-box {
  background: var(--bg-card);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  padding: 24px; margin-top: 16px;
}
.contact-box p { margin: 4px 0; font-size: 14px; }
.contact-box a { color: var(--accent); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--separator);
  padding: 48px 24px;
  background: #0A0A0C;
}

/* Light mode footer */
html[data-theme="light"] footer {
  background: #F8F8FA;
}

.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 40px 80px;
  align-items: flex-start;
}
.footer-appstore-col { display: flex; align-items: flex-start; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.footer-brand img { width: 36px; height: 36px; border-radius: 9px; }
.footer-brand span { font-size: 17px; font-weight: 700; }
.footer-desc { font-size: 14px; color: var(--text-muted); max-width: 240px; line-height: 1.5; }
.footer-appstore-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 16px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px; color: var(--text-primary); text-decoration: none;
  font-size: 14px; font-weight: 600; line-height: 1.3; transition: background 0.2s;
}

/* Light mode footer badge */
html[data-theme="light"] .footer-appstore-badge {
  background: rgba(0,0,0,0.06); border: 1px solid rgba(0,0,0,0.1);
  color: var(--text);
}

.footer-appstore-badge:hover { background: rgba(255,255,255,0.15); }

html[data-theme="light"] .footer-appstore-badge:hover {
  background: rgba(0,0,0,0.12);
}

.footer-appstore-badge small {
  display: block; font-size: 10px; color: var(--text-muted);
  font-weight: 400; text-transform: uppercase; letter-spacing: 0.6px;
}
.footer-col { min-width: 160px; }
.footer-col h4 { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul li a { font-size: 15px; color: var(--text-secondary); }
.footer-col ul li a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1100px; margin: 40px auto 0;
  padding-top: 24px; border-top: 1px solid var(--separator);
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: center;
}
.footer-bottom p { font-size: 13px; color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .hero h1 { font-size: 52px; }
  .pro-card { padding: 40px 24px; }
  .features-grid { grid-template-columns: 1fr; }
  .screenshot-item img { height: 440px; }
  .stats-inner { gap: 24px; }
  .stat-value { font-size: 24px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .screenshots-shell { gap: 8px; }
  .carousel-button { display: none; }
}
@media (max-width: 480px) {
  .stats-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px; }
  .hero-ctas { flex-direction: column; align-items: center; }
  .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
  .screenshots-scroll { grid-auto-columns: minmax(220px, 82vw); }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════
   Legal Pages — Premium Additions
   ═══════════════════════════════════════ */

/* ── Scroll Progress Bar ── */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 3px;
  background: transparent;
  pointer-events: none;
}
.scroll-progress-bar {
  height: 100%;
  background: var(--gradient-premium);
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ── Legal Layout (sidebar + content) ── */
.legal-layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 60px 24px 100px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}

/* ── TOC Sidebar ── */
.toc-sidebar {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}
.toc-nav-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
  transition: box-shadow .2s ease;
}
.toc-nav-pane::-webkit-scrollbar { display: none; }
.toc-nav-pane.has-top-shadow {
  box-shadow: inset 0 10px 10px -10px rgba(0, 0, 0, 0.6);
}
.toc-nav-pane.has-bottom-shadow {
  box-shadow: inset 0 -12px 12px -12px rgba(0, 0, 0, 0.75);
}
.toc-nav-pane.has-top-shadow.has-bottom-shadow {
  box-shadow:
    inset 0 10px 10px -10px rgba(0, 0, 0, 0.6),
    inset 0 -12px 12px -12px rgba(0, 0, 0, 0.75);
}
.toc-header {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--text-muted); text-transform: uppercase;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--separator);
}
.toc-nav { list-style: none; }
.toc-nav li { margin-bottom: 2px; }
.toc-nav a {
  display: block;
  font-size: 13px; color: var(--text-muted); font-weight: 500;
  padding: 7px 12px; border-radius: 8px;
  border-left: 2px solid transparent;
  transition: all .2s; line-height: 1.4;
  text-decoration: none;
}
.toc-nav a:hover { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.toc-nav a.active {
  color: var(--premium); background: rgba(191,90,242,0.08);
  border-left-color: var(--premium); font-weight: 600;
}

/* ── Legal Meta Bar ── */
.legal-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--separator);
}
.legal-meta-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
}
.legal-meta-item svg { opacity: 0.5; }
.legal-meta-badge {
  background: rgba(191,90,242,0.12);
  border: 1px solid rgba(191,90,242,0.2);
  color: var(--premium);
  padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
}

/* ── Section Anchors & Headers ── */
.legal-section-anchor { display: block; height: 80px; margin-top: -80px; visibility: hidden; }
.legal-section { margin-bottom: 56px; }
.legal-section-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--separator);
}
.section-number {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-muted); flex-shrink: 0;
  min-width: 28px; font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.legal-section h2 {
  font-size: clamp(18px, 2.5vw, 22px); font-weight: 700;
  color: var(--text); flex: 1; margin: 0;
  line-height: 1.3;
}
.legal-section h3 {
  font-size: 15px; font-weight: 700; margin: 24px 0 10px;
  color: var(--text); letter-spacing: -0.2px;
}
.legal-section h3::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--premium); margin-right: 8px;
  vertical-align: middle; margin-bottom: 2px;
}
.legal-section p { font-size: 15px; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.75; }
.legal-section ul { list-style: none; padding-left: 0; margin-bottom: 12px; }
.legal-section ul li {
  font-size: 15px; color: var(--text-secondary);
  padding: 8px 0 8px 28px; position: relative; line-height: 1.6;
  border-bottom: 1px solid rgba(84,84,88,0.2);
}
.legal-section ul li:last-child { border-bottom: none; }
.legal-section ul li::before {
  content: '•'; position: absolute; left: 8px;
  color: var(--premium); font-weight: 700; font-size: 16px; top: 7px;
}

/* ── Info Box (blue accent) ── */
.info-box {
  background: rgba(10,132,255,0.08);
  border: 1px solid rgba(10,132,255,0.2);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 18px 20px; margin: 16px 0;
}
.info-box-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.info-box-icon { display: flex; align-items: center; flex-shrink: 0; }
.info-box-title { font-size: 14px; font-weight: 700; color: var(--accent); }
.info-box p { color: var(--text-secondary); margin: 0; font-size: 14px; line-height: 1.6; }
.info-box-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.info-box-row:last-child { margin-bottom: 0; }
.info-box-label { font-size: 13px; color: var(--text-muted); min-width: 80px; }
.info-box-value { font-size: 13px; color: var(--text); font-weight: 500; }
.info-box a.info-box-value { color: var(--accent); }

/* ── Warning Box (orange accent) ── */
.warning-box {
  background: rgba(255,149,0,0.08);
  border: 1px solid rgba(255,149,0,0.25);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 18px 20px; margin: 16px 0;
}
.warning-box-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.warning-box-icon { display: flex; align-items: center; flex-shrink: 0; }
.warning-box-title { font-size: 14px; font-weight: 700; color: var(--warning); }
.warning-box p { color: rgba(255,149,0,0.85); margin: 0; font-size: 14px; line-height: 1.6; }

/* ── Highlight Box (health/special) ── */
.highlight-box {
  background: rgba(52,199,89,0.06);
  border: 1px solid rgba(52,199,89,0.2);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-md);
  padding: 18px 20px; margin: 16px 0;
}
.highlight-box-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.highlight-box-title { font-size: 14px; font-weight: 700; color: var(--success); }
.highlight-box p { color: rgba(52,199,89,0.8); margin: 0; font-size: 14px; line-height: 1.6; }

/* ── Premium Highlight (purple accent) ── */
.premium-box {
  background: rgba(191,90,242,0.06);
  border: 1px solid rgba(191,90,242,0.2);
  border-left: 4px solid var(--premium);
  border-radius: var(--radius-md);
  padding: 18px 20px; margin: 16px 0;
}
.premium-box-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.premium-box-title { font-size: 14px; font-weight: 700; color: var(--premium); }
.premium-box p { color: var(--text-secondary); margin: 0; font-size: 14px; line-height: 1.6; }

/* ── Contact Box ── */
.contact-box {
  background: var(--bg-card);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  padding: 28px 32px; margin-top: 24px;
  text-align: center;
}
.contact-box-title {
  font-size: 18px; font-weight: 700; color: var(--text);
  margin-bottom: 6px;
}
.contact-box-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.contact-box-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.contact-link {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(10,132,255,0.1); border: 1px solid rgba(10,132,255,0.25);
  color: var(--accent); padding: 10px 20px; border-radius: 20px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: all .2s;
}
.contact-link:hover { background: rgba(10,132,255,0.18); transform: translateY(-1px); opacity: 1; }

/* ── Service Tags ── */
.service-row { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.service-tag {
  display: inline-flex; align-items: center;
  background: rgba(10,132,255,0.12); border: 1px solid rgba(10,132,255,0.25);
  color: var(--accent); padding: 4px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.service-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; padding-top: 3px; }

/* ── Legal Footer (inside content) ── */
.legal-footer-note {
  text-align: center; margin-top: 48px;
  padding-top: 24px; border-top: 1px solid var(--separator);
  font-size: 13px; color: var(--text-muted); line-height: 1.6;
}

/* ── Theme Toggle ── */
:root {
  --fab-size: 46px;
  --fab-right: 20px;
  --fab-bottom: 24px;
  --fab-gap: 12px;
}

.theme-toggle {
  position: fixed; bottom: var(--fab-bottom, 24px); right: var(--fab-right, 20px); z-index: 9999;
  width: var(--fab-size, 46px); height: var(--fab-size, 46px); border-radius: 50%;
  background: var(--gradient-premium);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(191,90,242,0.4);
  color: #fff;
  transition: transform .2s, box-shadow .2s, bottom .3s, right .3s, filter .2s;
  padding: 0;
  line-height: 0;
  min-height: var(--fab-size, 46px);
  min-width: var(--fab-size, 46px);
}
.theme-toggle:hover { transform: scale(1.12); box-shadow: 0 8px 32px rgba(191,90,242,0.6); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; }

.theme-toggle-icon {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Light mode theme toggle - ensure icon visibility */
html[data-theme="light"] .theme-toggle {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* ── Back to Top ── */
.back-to-top {
  position: fixed;
  bottom: calc(var(--fab-bottom, 24px) + var(--fab-size, 46px) + var(--fab-gap, 12px));
  right: var(--fab-right, 20px);
  z-index: 9998;
  width: var(--fab-size, 46px); height: var(--fab-size, 46px); border-radius: 50%;
  background: var(--gradient-accent);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(10,132,255,0.3);
  opacity: 0; pointer-events: none;
  transform: translateY(12px);
  transition: opacity .3s, transform .3s, visibility .3s;
  color: #fff; font-size: 18px;
  visibility: hidden;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); visibility: visible; }
.back-to-top:hover { transform: translateY(-2px); box-shadow: 0 6px 32px rgba(10,132,255,0.5); }
.back-to-top:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; }

/* Mobile responsive */
@media (max-width: 480px) {
  :root {
    --fab-size: 40px;
    --fab-right: 16px;
    --fab-bottom: 16px;
    --fab-gap: 10px;
  }

  .theme-toggle {
    box-shadow: 0 2px 16px rgba(191,90,242,0.35);
  }
  .theme-toggle-icon { width: 16px; height: 16px; }
  .theme-toggle:hover { box-shadow: 0 4px 20px rgba(191,90,242,0.5); }
  
  .back-to-top {
    font-size: 16px;
    box-shadow: 0 2px 16px rgba(10,132,255,0.25);
  }
}

/* ── Fade-in animation ── */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── Legal Hero ── */
.legal-hero-enhanced {
  padding: 120px 24px 56px;
  background: linear-gradient(160deg, #111113 0%, #1a0a2e 60%, #0a1a2e 100%);
  text-align: center; position: relative; overflow: hidden;
}
.legal-hero-enhanced::before {
  content: ''; position: absolute; top: -150px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(191,90,242,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.legal-hero-icon {
  width: 72px; height: 72px; border-radius: 20px;
  margin: 0 auto 20px; display: block;
  box-shadow: 0 8px 32px rgba(191,90,242,0.3), 0 4px 16px rgba(0,0,0,0.5);
}
.legal-hero-enhanced h1 {
  font-size: clamp(28px, 5vw, 48px); font-weight: 800; letter-spacing: -1.5px;
  color: #fff; margin-bottom: 12px;
}
.legal-hero-enhanced p { color: var(--text-muted); font-size: 14px; max-width: 500px; margin: 0 auto; }

/* ── How it Works (index) ── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px; margin-top: 48px; position: relative;
}
.step-card {
  background: var(--bg-card); border: 1px solid var(--separator);
  border-radius: var(--radius-lg); padding: 32px 28px;
  transition: transform .2s, border-color .2s;
  text-align: center;
}
.step-card:hover { transform: translateY(-4px); border-color: rgba(191,90,242,0.3); }
.step-number {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--gradient-premium);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff;
  margin: 0 auto 20px;
  box-shadow: 0 4px 20px rgba(191,90,242,0.35);
}
.step-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.step-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.steps-connector {
  display: none;
}

/* ── Carousel dots ── */
.carousel-dots {
  display: flex; gap: 4px; justify-content: center; margin-top: 8px;
}
.carousel-dot {
  /* 44px tap target via padding, visually 6/20px */
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--separator); cursor: pointer;
  transition: all .2s; border: none;
  padding: 19px 10px;
  background-clip: content-box;
  box-sizing: content-box;
}
.carousel-dot.active {
  width: 20px; border-radius: 3px;
  background: var(--premium);
  background-clip: content-box;
}

/* ── Print styles ── */
@media print {
  .scroll-progress, .site-nav, .toc-sidebar, .back-to-top, .lang-tabs { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .legal-hero-enhanced { background: #f5f5f7 !important; color: #000 !important; padding: 24px !important; }
  .legal-hero-enhanced h1, .legal-hero-enhanced p { color: #000 !important; -webkit-text-fill-color: #000 !important; }
  .legal-layout { display: block !important; padding: 16px !important; }
  .legal-section h2 { color: #000 !important; }
  .legal-section p, .legal-section ul li { color: #333 !important; }
  .info-box, .warning-box, .highlight-box { border: 1px solid #ccc !important; background: #f9f9f9 !important; }
  .contact-box { border: 1px solid #ccc !important; background: #f9f9f9 !important; }
  .legal-content { display: block !important; }
  .lang-content { display: block !important; }
}

/* ── Responsive: hide sidebar on mobile ── */
@media (max-width: 960px) {
  .legal-layout { grid-template-columns: 1fr; }
  .toc-sidebar { display: none; }
}
@media (max-width: 768px) {
  .legal-layout { padding: 32px 20px 80px; }
  .legal-section h2 { font-size: 18px; }
  .legal-meta { gap: 10px; }
  .contact-box { padding: 24px 20px; }
}
