:root {
  --bg-dark: #070b1e;
  --bg-panel: rgba(15, 23, 42, 0.85);
  --line: rgba(255, 255, 255, 0.08);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #7b61ff;
  --accent-hover: #6d5efc;
  --success: #22d3ee;
  --danger: #ef4444;
  --warning: #f59e0b;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.backdrop-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(123, 97, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(123, 97, 255, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

.noise-layer {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 30, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0.95rem 0;
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s;
}

.brand:hover {
  transform: translateY(-2px);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(123, 97, 255, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-text strong {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, #7b61ff, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-text small {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 1.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

.mobile-menu-btn:hover {
  background: rgba(123, 97, 255, 0.15);
  border-color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  transition: 0.2s;
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: transform 0.3s;
}

.site-nav a:hover {
  color: var(--success);
}

.site-nav a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.main-content {
  position: relative;
  z-index: 2;
  padding: 2rem 0;
  min-height: calc(100vh - 120px);
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6d5efc);
  color: #fff;
  box-shadow: 0 4px 14px rgba(123, 97, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(123, 97, 255, 0.6);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select,
.chat-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: 0.2s;
}

input:focus,
textarea:focus,
select:focus,
.chat-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.15);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #fff, var(--success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

a {
  color: var(--accent);
  transition: color 0.2s;
}

a:hover {
  color: var(--success);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 280px;
    height: calc(100vh - 70px);
    background: rgba(7, 11, 30, 0.98);
    backdrop-filter: blur(12px);
    border-left: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 0.5rem;
    transition: right 0.3s;
    z-index: 999;
  }

  .site-nav.open {
    right: 0;
  }

  .site-nav a {
    width: 100%;
    padding: 0.8rem 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
