:root {
  --background: 226 58% 97%;
  --foreground: 231 24% 12%;
  --primary: 258 88% 58%;
  --primary-foreground: 0 0% 100%;
  --secondary: 188 94% 43%;
  --secondary-foreground: 222 47% 11%;
  --muted: 228 30% 92%;
  --muted-foreground: 228 13% 42%;
  --destructive: 350 84% 56%;
  --destructive-foreground: 0 0% 100%;
  --border: 228 24% 84%;
  --card: 0 0% 100%;
  --shadow-sm: 0 1px 2px hsl(231 24% 12% / 0.06), 0 0 0 1px hsl(228 24% 84% / 0.36);
  --shadow-md: 0 18px 45px hsl(231 24% 12% / 0.10), 0 1px 0 hsl(0 0% 100% / 0.65) inset;
  --shadow-lg: 0 28px 90px hsl(231 24% 12% / 0.18), 0 0 0 1px hsl(228 24% 84% / 0.28);
  --transition-fast: 140ms ease;
  --transition-smooth: 260ms cubic-bezier(.2,.8,.2,1);
  --radius-sm: 0.75rem;
  --radius-md: 1.15rem;
  --radius-lg: 1.7rem;
}

.dark {
  --background: 231 43% 7%;
  --foreground: 226 58% 97%;
  --primary: 263 94% 70%;
  --primary-foreground: 231 43% 7%;
  --secondary: 187 96% 49%;
  --secondary-foreground: 231 43% 7%;
  --muted: 230 28% 17%;
  --muted-foreground: 226 18% 74%;
  --destructive: 350 88% 65%;
  --destructive-foreground: 0 0% 100%;
  --border: 230 26% 25%;
  --card: 229 34% 12%;
  --shadow-sm: 0 1px 2px hsl(0 0% 0% / 0.22), 0 0 0 1px hsl(230 26% 25% / 0.55);
  --shadow-md: 0 20px 55px hsl(0 0% 0% / 0.32), 0 1px 0 hsl(0 0% 100% / 0.06) inset;
  --shadow-lg: 0 32px 110px hsl(0 0% 0% / 0.42), 0 0 0 1px hsl(230 26% 25% / 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: hsl(var(--foreground));
  background:
    radial-gradient(circle at 8% -8%, hsl(var(--primary) / 0.28), transparent 27rem),
    radial-gradient(circle at 88% 8%, hsl(var(--secondary) / 0.22), transparent 24rem),
    radial-gradient(circle at 50% 115%, hsl(var(--primary) / 0.12), transparent 25rem),
    linear-gradient(135deg, hsl(var(--background)), hsl(var(--muted) / 0.72));
  background-attachment: fixed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-rendering: geometricPrecision;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(hsl(var(--foreground) / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--foreground) / 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

.dark body::before {
  background-image:
    linear-gradient(hsl(var(--foreground) / 0.055) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--foreground) / 0.055) 1px, transparent 1px);
}

#root { min-height: 100vh; }

::selection {
  background: hsl(var(--primary) / 0.22);
  color: hsl(var(--foreground));
}

button, a, input, select { -webkit-tap-highlight-color: transparent; }

button, a {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast);
}

button:not(:disabled):active, a:active { transform: translateY(1px) scale(0.99); }

input, select {
  font-size: max(16px, 1rem);
  color: hsl(var(--foreground));
}

input::placeholder { color: hsl(var(--muted-foreground) / 0.74); }

.bg-1 { background: hsl(var(--background)); }
.bg-2 { background: hsl(var(--card)); }
.bg-3 { background: hsl(var(--muted)); }
.bg-4 { background: hsl(var(--primary) / 0.1); }
.text-primary { color: hsl(var(--foreground)); }
.text-secondary { color: hsl(var(--muted-foreground)); }
.text-tertiary { color: hsl(var(--muted-foreground) / 0.78); }
.accent { color: hsl(var(--primary)); }

.card-shadow { box-shadow: var(--shadow-md); }
.soft-shadow { box-shadow: var(--shadow-sm); }

.card-shadow,
.soft-shadow {
  backdrop-filter: blur(18px);
}

.dark .bg-white,
.dark .hover\:bg-gray-100:hover,
.dark .hover\:bg-gray-50:hover {
  background-color: hsl(var(--card)) !important;
}

.dark .text-gray-700,
.dark .text-secondary {
  color: hsl(var(--muted-foreground));
}

.dark .border-gray-300,
.dark .border-gray-100,
.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
  border-color: hsl(var(--border));
}
