:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --background: 210 45% 97%;
  --foreground: 222 55% 9%;
  --card: 0 0% 100%;
  --card-foreground: 222 55% 9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 55% 9%;
  --primary: 176 78% 38%;
  --primary-foreground: 178 100% 8%;
  --secondary: 215 28% 94%;
  --secondary-foreground: 222 55% 12%;
  --muted: 216 30% 93%;
  --muted-foreground: 216 16% 43%;
  --accent: 39 96% 55%;
  --accent-foreground: 28 80% 10%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --success: 142 70% 45%;
  --success-foreground: 0 0% 100%;
  --warning: 38 92% 50%;
  --warning-foreground: 28 74% 12%;
  --info: 215 90% 55%;
  --info-foreground: 0 0% 100%;
  --border: 214 30% 86%;
  --input: 214 30% 86%;
  --ring: 176 78% 38%;
  --radius: 1rem;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 34px -20px rgba(15, 23, 42, 0.35), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 70px -28px rgba(15, 23, 42, 0.42), 0 12px 24px rgba(15, 23, 42, 0.08);
  --shadow-elegant: 0 24px 80px hsl(var(--primary) / 0.18);
}

.dark {
  --background: 224 55% 5%;
  --foreground: 210 40% 98%;
  --card: 224 48% 8%;
  --card-foreground: 210 40% 98%;
  --popover: 224 48% 8%;
  --popover-foreground: 210 40% 98%;
  --primary: 176 88% 45%;
  --primary-foreground: 180 100% 5%;
  --secondary: 224 35% 13%;
  --secondary-foreground: 210 40% 98%;
  --muted: 224 35% 12%;
  --muted-foreground: 215 20% 72%;
  --accent: 43 96% 60%;
  --accent-foreground: 28 80% 10%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --success: 142 70% 45%;
  --success-foreground: 0 0% 100%;
  --warning: 38 92% 55%;
  --warning-foreground: 28 74% 12%;
  --info: 215 90% 60%;
  --info-foreground: 222 47% 8%;
  --border: 222 30% 18%;
  --input: 222 30% 18%;
  --ring: 176 88% 45%;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: hsl(var(--background));
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 12% 8%, hsl(var(--primary) / 0.16), transparent 26rem),
    radial-gradient(circle at 85% 15%, hsl(var(--accent) / 0.11), transparent 24rem),
    linear-gradient(180deg, hsl(var(--background)), hsl(var(--background)) 58%, hsl(var(--muted) / 0.45));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea {
  font: inherit;
}

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

#root {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-shell {
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  .app-shell {
    padding-bottom: 2rem;
  }
}

.bottom-safe {
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}

.premium-card {
  background:
    linear-gradient(145deg, hsl(var(--card) / 0.96), hsl(var(--card) / 0.82)),
    radial-gradient(circle at 18% 0%, hsl(var(--primary) / 0.10), transparent 18rem);
  border: 1px solid hsl(var(--border) / 0.58);
  box-shadow: var(--shadow-md);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

.premium-card:hover {
  transform: translateY(-3px);
  border-color: hsl(var(--primary) / 0.28);
  box-shadow: var(--shadow-lg), 0 0 28px hsl(var(--primary) / 0.07);
}

.glass-panel {
  background: hsl(var(--card) / 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid hsl(var(--border) / 0.58);
}

.tab-slider-container {
  background: hsl(var(--muted) / 0.68);
  border: 1px solid hsl(var(--border) / 0.55);
  padding: 5px;
  border-radius: 18px;
  display: flex;
  gap: 4px;
}

.tab-slider-button {
  flex: 1;
  min-height: 42px;
  padding: 9px 16px;
  font-size: 0.875rem;
  font-weight: 800;
  border-radius: 14px;
  transition: all 0.2s ease;
}

.tab-slider-button.active {
  background: linear-gradient(135deg, hsl(var(--card)), hsl(var(--card) / 0.9));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm), inset 0 1px 0 hsl(0 0% 100% / 0.06);
}

.premium-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.premium-input:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 4px hsl(var(--primary) / 0.15);
  transform: translateY(-1px);
}

.pulse-glow {
  box-shadow: 0 0 15px hsl(var(--primary) / 0.22);
  animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 8px hsl(var(--primary) / 0.14);
  }
  100% {
    box-shadow: 0 0 22px hsl(var(--primary) / 0.34);
  }
}

.hero-panel {
  background:
    linear-gradient(145deg, hsl(var(--card) / 0.94), hsl(var(--card) / 0.78)),
    radial-gradient(circle at 12% 12%, hsl(var(--primary) / 0.20), transparent 20rem),
    radial-gradient(circle at 95% 0%, hsl(var(--accent) / 0.10), transparent 18rem);
  border: 1px solid hsl(var(--border) / 0.58);
  box-shadow: var(--shadow-lg);
}

.signal-grid {
  background-image:
    linear-gradient(hsl(var(--border) / 0.42) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.42) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

.auth-screen {
  background:
    radial-gradient(circle at 16% 18%, hsl(var(--primary) / 0.20), transparent 23rem),
    radial-gradient(circle at 84% 22%, hsl(var(--accent) / 0.16), transparent 24rem),
    radial-gradient(circle at 50% 100%, hsl(199 89% 48% / 0.12), transparent 28rem),
    hsl(var(--background));
}

.auth-shell {
  background: hsl(var(--popover) / 0.48);
  border: 1px solid hsl(var(--border) / 0.62);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.auth-card {
  background:
    linear-gradient(145deg, hsl(var(--card) / 0.96), hsl(var(--card) / 0.84)),
    radial-gradient(circle at 20% 0%, hsl(var(--primary) / 0.10), transparent 18rem);
  border: 1px solid hsl(var(--border) / 0.68);
  box-shadow: var(--shadow-lg), inset 0 1px 0 hsl(0 0% 100% / 0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.auth-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(42px);
  opacity: 0.55;
  pointer-events: none;
}

.auth-orb-one {
  top: 3rem;
  right: -4rem;
  height: 12rem;
  width: 12rem;
  background: hsl(var(--primary) / 0.25);
}

.auth-orb-two {
  bottom: 3rem;
  left: -4rem;
  height: 14rem;
  width: 14rem;
  background: hsl(var(--accent) / 0.18);
}

.focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}