/* Reset & base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
:root {
  --color-bg: #f8fafc;
  --color-text: #334155;
  --color-muted: #64748b;
  --color-accent: #3b82f6;
  --color-accent-2: #1d4ed8;
  --color-accent-light: #60a5fa;
  --color-surface: #ffffff;
  --color-surface-2: #f1f5f9;
  --color-border: #e2e8f0;
  --color-primary: #3b82f6;
  --color-secondary: #1d4ed8;
  --color-tertiary: #60a5fa;
  --shadow-elev: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --gradient-bg: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 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.6;
  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 20% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(29, 78, 216, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  background: var(--gradient-primary);
  color: #fff;
  padding: 100px 0 60px;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--color-accent);
}

.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
  pointer-events: none;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-secondary) 50%, var(--color-tertiary) 100%);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* Center title in header */
.site-header .container { 
  text-align: center; 
  position: relative;
  z-index: 1;
}

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

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

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

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

.site-title .support:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

main.container {
  background: var(--color-surface);
  margin-top: -40px;
  border-radius: 25px;
  padding: 50px;
  box-shadow: var(--shadow-elev);
  border: 2px solid var(--color-border);
  position: relative;
  z-index: 2;
  backdrop-filter: blur(10px);
}

main.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, rgba(29, 78, 216, 0.02) 100%);
  border-radius: 25px;
  pointer-events: none;
}

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

.toc { 
  background: var(--color-surface-2); 
  border: 1px solid var(--color-border); 
  border-radius: 16px; 
  padding: 20px; 
  box-shadow: var(--shadow-soft);
  position: relative;
}

.toc::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
  border-radius: 16px 16px 0 0;
}

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

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

.toc ol { 
  margin: 8px 0 0; 
  padding-left: 20px; 
}

.toc a { 
  color: var(--color-text); 
  text-decoration: none; 
  transition: all .3s ease; 
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  margin: 2px 0;
  position: relative;
  font-weight: 500;
}

.toc a:hover { 
  color: var(--color-primary); 
  background: rgba(59, 130, 246, 0.08);
  transform: translateX(3px);
}

.toc a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: var(--color-primary);
  border-radius: 1px;
  transition: height 0.3s ease;
}

.toc a:hover::before {
  height: 100%;
}

.content { 
  max-width: 760px; 
}

section { 
  scroll-margin-top: 100px; 
}

h2 { 
  margin-top: 32px; 
  font-size: 28px; 
  color: var(--color-primary); 
  letter-spacing: -0.3px; 
  position: relative; 
  font-weight: 700;
}

h2::after { 
  content: ""; 
  display: block; 
  width: 60px; 
  height: 3px; 
  margin-top: 8px; 
  background: var(--color-primary); 
  border-radius: 2px; 
}

h3 { 
  margin-top: 20px; 
  font-size: 20px; 
  color: var(--color-secondary); 
  font-weight: 600;
  position: relative;
  padding-left: 16px;
}

h3::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-primary);
  font-size: 14px;
}

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

ul { 
  margin: 16px 0 20px 30px; 
  position: relative;
}

li { 
  margin: 8px 0; 
  line-height: 1.7;
  position: relative;
  padding-left: 8px;
}

li::before {
  content: '•';
  position: absolute;
  left: -15px;
  color: var(--color-primary);
  font-size: 10px;
}

.content section + section { 
  border-top: 1px solid var(--color-border); 
  padding-top: 24px; 
  margin-top: 24px; 
  position: relative;
}

.content section + section::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 1px;
  background: var(--color-primary);
  border-radius: 1px;
}

.note { 
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); 
  border: 1px solid var(--color-border); 
  padding: 16px 20px; 
  border-radius: 12px; 
  box-shadow: var(--shadow-soft);
}

.table-wrap { 
  overflow-x: auto; 
  margin: 16px 0; 
}

table { 
  width: 100%; 
  border-collapse: collapse; 
  background: #fff; 
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

th, td { 
  border: 1px solid var(--color-border); 
  padding: 12px 16px; 
  text-align: left; 
}

th { 
  background: linear-gradient(135deg, var(--color-surface-2) 0%, #f0f9ff 100%); 
  color: var(--color-text);
  font-weight: 600;
}

.site-footer { 
  margin-top: 32px; 
  padding-top: 20px; 
  border-top: 1px solid var(--color-border); 
  color: var(--color-muted); 
}

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

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

.back-to-top:hover { 
  text-decoration: none; 
  background: var(--color-weather-blue);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

/* Form styles */
.form-card {
  margin-top: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
  position: relative;
}

.form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
  border-radius: 16px 16px 0 0;
}

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

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

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

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

.input, .textarea, select.input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  background: var(--color-surface);
  outline: none;
  transition: all .3s ease;
  box-shadow: var(--shadow-soft);
  color: var(--color-text);
}

.input:focus, .textarea:focus, select.input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), var(--shadow-soft);
  transform: translateY(-1px);
}

.textarea { 
  resize: vertical; 
}

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

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

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

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

.btn { 
  appearance: none; 
  border: 1px solid var(--color-border); 
  background: var(--color-surface); 
  color: var(--color-text); 
  padding: 12px 20px; 
  border-radius: 12px; 
  cursor: pointer; 
  font-weight: 600; 
  transition: all .3s ease; 
  box-shadow: var(--shadow-soft);
}

.btn:hover { 
  border-color: var(--color-weather-blue); 
  transform: translateY(-2px);
  box-shadow: var(--shadow-elev);
}

.btn:focus-visible { 
  outline: none; 
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15); 
}

.btn-primary { 
  background: var(--color-primary); 
  border-color: var(--color-primary); 
  color: #fff; 
  box-shadow: var(--shadow-soft); 
  font-weight: 600;
}

.btn-primary:hover { 
  background: var(--color-secondary); 
  border-color: var(--color-secondary);
  transform: translateY(-2px); 
  box-shadow: var(--shadow-elev);
}

.btn-ghost { 
  background: transparent; 
}

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

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

@media (max-width: 640px) {
  .site-title .brand { 
    font-size: 40px; 
  }
  .site-title .policy { 
    font-size: 20px; 
  }
  .site-title .support { 
    margin-left: 8px; 
    font-size: 12px; 
    padding: 3px 10px; 
  }
  main.container { 
    padding: 24px; 
    margin-top: -20px;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .actions {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
}

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

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

/* Smooth transitions for all interactive elements */
a, button, input, textarea, select {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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