/* Reset & base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
:root {
  --color-bg: #fafafa;
  --color-text: #1f2937;
  --color-muted: #6b7280;
  --color-accent: #7c3aed;
  --color-accent-2: #5b21b6;
  --color-accent-light: #a78bfa;
  --color-surface: #ffffff;
  --color-surface-2: #f5f3ff;
  --color-border: #e5e7eb;
  --color-primary: #7c3aed;
  --color-secondary: #5b21b6;
  --color-tertiary: #a78bfa;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(124, 58, 237, 0.12);
  --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  --gradient-bg: linear-gradient(180deg, #fafafa 0%, #f5f3ff 100%);
}

body {
  margin: 0;
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--gradient-bg);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 15% 85%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 85% 15%, rgba(91, 33, 182, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: var(--gradient-primary);
  color: #fff;
  padding: 80px 0 50px;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.site-header .container { 
  text-align: center; 
  position: relative;
  z-index: 1;
}

.site-title { 
  margin: 0; 
  line-height: 1.3; 
}

.site-title .brand { 
  display: block; 
  font-size: 52px; 
  font-weight: 700; 
  letter-spacing: -1px; 
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: #ffffff;
  position: relative;
  z-index: 2;
}

.site-title .policy { 
  display: block; 
  margin-top: 10px; 
  font-size: 18px; 
  font-weight: 500; 
  opacity: 0.92; 
  letter-spacing: 0.5px; 
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  position: relative;
  z-index: 2;
}

.site-title .support { 
  display: inline-block; 
  margin-top: 20px; 
  padding: 8px 20px; 
  font-size: 13px; 
  font-weight: 600; 
  color: var(--color-primary); 
  background: rgba(255, 255, 255, 0.95); 
  border: none; 
  border-radius: 24px; 
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.site-title .support:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 1);
}

main.container {
  background: var(--color-surface);
  margin-top: -30px;
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  position: relative;
  z-index: 2;
  margin-bottom: 40px;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
}

.toc { 
  background: var(--color-surface-2); 
  border: 1px solid var(--color-border); 
  border-radius: 12px; 
  padding: 20px; 
  box-shadow: var(--shadow-sm);
  position: relative;
  height: fit-content;
}

.sidebar { 
  position: sticky; 
  top: 20px; 
  align-self: start; 
}

.toc strong {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 14px;
  display: block;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.toc ol { 
  margin: 0; 
  padding-left: 18px; 
  list-style: none;
  counter-reset: toc-counter;
}

.toc ol li {
  counter-increment: toc-counter;
  position: relative;
  margin: 0 0 4px 0;
}

.toc ol li::before {
  content: counter(toc-counter);
  position: absolute;
  left: -18px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
}

.toc a { 
  color: var(--color-text); 
  text-decoration: none; 
  transition: all .25s ease; 
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.toc a:hover { 
  color: var(--color-primary); 
  background: rgba(124, 58, 237, 0.08);
  transform: translateX(4px);
}

.content { 
  max-width: 820px; 
}

section { 
  scroll-margin-top: 80px; 
  margin-bottom: 40px;
}

h2 { 
  margin-top: 0; 
  margin-bottom: 20px;
  font-size: 26px; 
  color: var(--color-primary); 
  letter-spacing: -0.5px; 
  font-weight: 700;
  position: relative;
  padding-bottom: 12px;
}

h2::after { 
  content: ""; 
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px; 
  height: 3px; 
  background: var(--color-primary); 
  border-radius: 2px; 
}

h3 { 
  margin-top: 24px; 
  margin-bottom: 12px;
  font-size: 18px; 
  color: var(--color-secondary); 
  font-weight: 600;
  position: relative;
  padding-left: 14px;
}

h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  background: var(--color-primary);
  border-radius: 2px;
}

p { 
  margin: 14px 0; 
  color: var(--color-text); 
  line-height: 1.8;
  font-size: 15px;
}

ul { 
  margin: 16px 0 20px 0; 
  padding-left: 24px;
  list-style: none;
}

li { 
  margin: 10px 0; 
  line-height: 1.75;
  position: relative;
  padding-left: 6px;
}

li::before {
  content: '●';
  position: absolute;
  left: -18px;
  color: var(--color-primary);
  font-size: 8px;
  top: 8px;
}

.content section + section { 
  border-top: 1px solid var(--color-border); 
  padding-top: 32px; 
}

.site-footer { 
  margin-top: 48px; 
  padding-top: 24px; 
  border-top: 2px solid var(--color-border); 
  color: var(--color-muted); 
  text-align: center;
}

.site-footer p {
  margin: 8px 0;
}

.site-footer .small { 
  font-size: 13px; 
  color: var(--color-muted); 
  opacity: 0.8;
}

.back-to-top { 
  display: inline-block; 
  margin-top: 16px; 
  color: var(--color-primary); 
  text-decoration: none; 
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: var(--color-surface);
  transition: all .3s ease;
}

.back-to-top:hover { 
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Form styles */
.form-card {
  margin-top: 24px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
}

.field.full { 
  grid-column: 1 / -1; 
}

.field label { 
  font-weight: 600; 
  color: var(--color-text); 
  font-size: 14px; 
}

.input, .textarea, select.input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--color-surface);
  outline: none;
  transition: all .25s ease;
  color: var(--color-text);
  font-family: inherit;
}

.input:focus, .textarea:focus, select.input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.textarea { 
  resize: vertical; 
  line-height: 1.6;
}

.helper-text { 
  margin-top: 4px; 
  color: var(--color-muted); 
  font-size: 12px; 
}

.checkbox-field .checkbox { 
  display: flex; 
  gap: 10px; 
  align-items: flex-start; 
}

.checkbox-field input[type="checkbox"] { 
  margin-top: 3px; 
  cursor: pointer;
}

.actions { 
  display: flex; 
  gap: 12px; 
  margin-top: 20px; 
}

.btn { 
  appearance: none; 
  border: 1px solid var(--color-border); 
  background: var(--color-surface); 
  color: var(--color-text); 
  padding: 11px 24px; 
  border-radius: 8px; 
  cursor: pointer; 
  font-weight: 600; 
  font-size: 14px;
  transition: all .25s ease; 
  font-family: inherit;
}

.btn:hover { 
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary { 
  background: var(--color-primary); 
  border-color: var(--color-primary); 
  color: #fff; 
}

.btn-primary:hover { 
  background: var(--color-secondary); 
  border-color: var(--color-secondary);
}

.btn-ghost { 
  background: transparent; 
}

.btn-ghost:hover {
  background: var(--color-surface-2);
}

/* Responsive design */
@media (max-width: 960px) {
  .layout { 
    grid-template-columns: 1fr; 
    gap: 24px;
  }
  .sidebar { 
    position: static; 
  }
  .content { 
    max-width: 100%; 
  }
  main.container {
    padding: 32px;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 60px 0 40px;
  }
  .site-title .brand { 
    font-size: 36px; 
  }
  .site-title .policy { 
    font-size: 16px; 
  }
  .site-title .support { 
    font-size: 12px; 
    padding: 6px 16px; 
  }
  main.container { 
    padding: 24px; 
    margin-top: -20px;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .actions {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
  h2 {
    font-size: 22px;
  }
  h3 {
    font-size: 17px;
  }
}

/* Smooth animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-header .brand {
  animation: fadeIn 0.6s ease-out;
}

.site-header .policy {
  animation: fadeIn 0.8s ease-out;
}

/* Enhanced focus states for accessibility */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

