:root {
  --primary: oklch(0.38 0.085 259);
  --muted: oklch(0.955 0.008 250);
  --gradient-hero: linear-gradient(160deg, oklch(0.38 0.085 259), oklch(0.3 0.07 262));
}

* {
  border-color: var(--color-border);
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background-color: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-body);
  margin: 0;
}

h1,
h2,
h3,
legend {
  font-family: var(--font-display);
}

[id] {
  scroll-margin-top: 5rem;
}

.hero {
  background: var(--gradient-hero);
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Campos */
.lbl {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-foreground);
}

.inp {
  display: block;
  width: 100%;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  padding: 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--color-foreground);
  outline: none;
}

.inp:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 20%, transparent);
}

.inp[readonly] {
  background: var(--color-muted);
  color: var(--color-muted-foreground);
}

.inp:disabled {
  background: var(--color-muted);
  color: var(--color-muted-foreground);
  cursor: not-allowed;
  opacity: 0.7;
}

.inp[aria-invalid="true"] {
  border-color: var(--color-destructive);
}

.inp[aria-invalid="true"]:focus {
  border-color: var(--color-destructive);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-destructive) 20%, transparent);
}

/* Spinner do "Verificando CPF..." */
.spinner {
  display: inline-block;
  height: 0.875rem;
  width: 0.875rem;
  flex-shrink: 0;
  border-radius: 9999px;
  border: 2px solid color-mix(in oklab, var(--color-primary) 25%, transparent);
  border-top-color: var(--color-primary);
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2s;
  }
}

/* Cards de ícone flutuantes do topo */
.icon-glass {
  display: flex;
  height: 4rem;
  width: 4rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  border: 1px solid rgb(255 255 255 / 0.15);
  background: rgb(255 255 255 / 0.1);
  padding: 1rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.15);
  color: var(--color-secondary);
}

.icon-glass svg {
  height: 100%;
  width: 100%;
}

/* Destaque ao rolar para o formulário */
@keyframes target-glow {
  0% {
    box-shadow: 0 0 0 0 var(--color-secondary);
    transform: scale(1);
  }
  35% {
    box-shadow: 0 0 0 10px color-mix(in oklab, var(--color-secondary) 35%, transparent);
    transform: scale(1.01);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
    transform: scale(1);
  }
}

.target-highlight {
  border-radius: 1.25rem;
  animation: target-glow 1.4s ease-out;
}

/* Flutuação dos ícones */
@keyframes float-orbit {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  25% {
    transform: translate3d(6px, -10px, 0) rotate(3deg);
  }
  50% {
    transform: translate3d(0, -16px, 0) rotate(0deg);
  }
  75% {
    transform: translate3d(-6px, -8px, 0) rotate(-3deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

.float-card {
  animation: float-orbit 6s ease-in-out infinite;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .float-card {
    animation: none;
  }
}

/* Texturas */
.page-texture {
  position: relative;
  background-color: var(--muted);
  background-image: radial-gradient(
    color-mix(in oklab, var(--primary) 12%, transparent) 1px,
    transparent 1px
  );
  background-size: 22px 22px;
  background-repeat: repeat;
}

.grid-texture {
  background-image:
    linear-gradient(
      to right,
      color-mix(in oklab, var(--primary) 7%, transparent) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      color-mix(in oklab, var(--primary) 7%, transparent) 1px,
      transparent 1px
    );
  background-size: 48px 48px;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 700ms ease-out,
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.parallax {
  will-change: transform, opacity;
}
