:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --background: 42 38% 96%;
  --foreground: 218 28% 14%;
  --card: 40 48% 99%;
  --card-foreground: 218 28% 14%;
  --popover: 40 48% 99%;
  --popover-foreground: 218 28% 14%;
  --primary: 170 64% 27%;
  --primary-foreground: 38 52% 96%;
  --secondary: 32 45% 88%;
  --secondary-foreground: 219 24% 18%;
  --muted: 35 28% 89%;
  --muted-foreground: 218 12% 40%;
  --accent: 18 78% 55%;
  --accent-foreground: 42 42% 97%;
  --destructive: 0 74% 45%;
  --destructive-foreground: 42 42% 97%;
  --success: 145 58% 31%;
  --success-foreground: 42 42% 97%;
  --warning: 38 92% 39%;
  --warning-foreground: 218 28% 14%;
  --info: 210 72% 40%;
  --info-foreground: 42 42% 97%;
  --border: 35 24% 78%;
  --input: 35 24% 78%;
  --ring: 170 64% 27%;
  --radius: 0.625rem;
  --shadow-sm: 0 1px 2px hsl(var(--foreground) / 0.05);
  --shadow-md: 0 4px 12px hsl(var(--foreground) / 0.08);
  --shadow-lg: 0 12px 32px hsl(var(--foreground) / 0.12);
  --shadow-elegant: 0 20px 60px hsl(var(--primary) / 0.18);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
  --background: 218 28% 10%;
  --foreground: 39 42% 93%;
  --card: 218 24% 14%;
  --card-foreground: 39 42% 93%;
  --popover: 218 24% 14%;
  --popover-foreground: 39 42% 93%;
  --primary: 166 52% 54%;
  --primary-foreground: 219 32% 10%;
  --secondary: 217 19% 21%;
  --secondary-foreground: 39 42% 93%;
  --muted: 217 19% 18%;
  --muted-foreground: 38 16% 72%;
  --accent: 20 84% 61%;
  --accent-foreground: 219 32% 10%;
  --destructive: 0 72% 57%;
  --destructive-foreground: 39 42% 93%;
  --success: 145 50% 52%;
  --success-foreground: 219 32% 10%;
  --warning: 42 92% 64%;
  --warning-foreground: 219 32% 10%;
  --info: 206 78% 62%;
  --info-foreground: 219 32% 10%;
  --border: 217 18% 28%;
  --input: 217 18% 28%;
  --ring: 166 52% 54%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, hsl(var(--accent) / 0.14), transparent 28rem),
    radial-gradient(circle at 88% 8%, hsl(var(--primary) / 0.16), transparent 26rem),
    hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 80;
  transform: translateY(-150%);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
}

.signature-card {
  background:
    linear-gradient(145deg, hsl(var(--card) / 0.96), hsl(var(--secondary) / 0.58)),
    radial-gradient(circle at 20% 20%, hsl(var(--primary) / 0.22), transparent 18rem);
}

.paper-grid {
  background-image:
    linear-gradient(hsl(var(--border) / 0.46) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.46) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}