/* ============================================================
   Base: reset, tipografia e fundo
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(10px);
}

body::before {
  width: 38rem;
  height: 38rem;
  top: -16rem;
  right: -12rem;
  background: radial-gradient(circle at center, rgba(251, 227, 233, 0.9), rgba(251, 227, 233, 0) 70%);
}

body::after {
  width: 34rem;
  height: 34rem;
  bottom: -14rem;
  left: -10rem;
  background: radial-gradient(circle at center, rgba(221, 238, 249, 0.85), rgba(221, 238, 249, 0) 70%);
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-body); }

p { margin: 0; }

a {
  color: var(--blush-600);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--blush-500); }

ul, ol { margin: 0; padding-left: 1.25rem; }

img, svg { max-width: 100%; }

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

button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 0.35rem;
}

::selection {
  background: var(--blush-200);
  color: var(--ink);
}

/* Utilidades */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  transform: translateY(-160%);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--duration-base) var(--ease-out);
}

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

.muted { color: var(--slate); }
.small { font-size: var(--text-sm); }
.tiny { font-size: var(--text-xs); }
.strong { font-weight: 800; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }
.text-center { text-align: center; }
.text-danger { color: var(--alert-text); }
.text-success { color: var(--success-text); }
.text-warning { color: var(--warning-text); }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack--sm { gap: var(--space-2); }
.stack--lg { gap: var(--space-6); }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.grow { flex: 1; }

/* Boot */
.app-boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.boot-loader {
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  padding: var(--space-8);
  text-align: center;
  animation: boot-float 3s var(--ease-out) infinite;
}

.boot-loader img { border-radius: var(--radius-md); box-shadow: var(--shadow-md); }

.boot-loader__text {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--slate);
}

@keyframes boot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

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

/* Noscript */
.noscript {
  max-width: 34rem;
  margin: 12vh auto;
  padding: var(--space-8);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
}

/* Toasts */
.toast-region {
  position: fixed;
  z-index: var(--z-toast);
  right: var(--space-5);
  bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}

@media (max-width: 767px) {
  .toast-region {
    right: var(--space-4);
    bottom: calc(var(--bottom-nav-h) + var(--space-4));
    left: var(--space-4);
    width: auto;
  }
}

/* Scrollbar discreta (WebKit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
