/* ============================================================
   ESSENCIAL — Foundation Stylesheet
   Reset moderno + base + primitivas de componente reutilizáveis.
   Importe DEPOIS dos tokens.
   ============================================================ */

@import url('../tokens/colors.css');
@import url('../tokens/typography.css');
@import url('../tokens/spacing.css');

/* ============================================================
   MODERN RESET (Josh Comeau's + customizações Essencial)
   ============================================================ */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body { height: 100%; }

body {
  line-height: var(--leading-relaxed);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-surface);
  font-synthesis: none;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button { background: none; border: none; cursor: pointer; }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

#root, #__next { isolation: isolate; }

a {
  color: var(--color-text-brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--duration-base) var(--ease-gentle);
}
a:hover { color: var(--color-brand-hover); }

::selection {
  background-color: var(--color-terracotta-200);
  color: var(--color-terracotta-800);
}

/* Scrollbar calibrada com a marca */
@supports (scrollbar-color: auto) {
  html { scrollbar-color: var(--color-terracotta-300) var(--color-cream-100); }
}

/* Focus visível, caloroso, acessível */
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   HEADINGS — defaults aplicados diretamente ao HTML
   ============================================================ */

h1 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-variation-settings: 'opsz' var(--opsz-subhead);
  color: var(--color-ink-700);
}

h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

h3 {
  font-family: var(--font-sans);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

h4 {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--gutter-md);
}
@media (min-width: 48em) { .container { padding-inline: var(--gutter-lg); } }

.container-prose { max-width: var(--container-prose); margin-inline: auto; }
.container-sm    { max-width: var(--container-sm); margin-inline: auto; }

.section { padding-block: var(--section-md); }
.section-sm { padding-block: var(--section-sm); }
.section-lg { padding-block: var(--section-lg); }

.stack > * + * { margin-top: var(--stack-space, var(--space-4)); }

/* ============================================================
   COMPONENTES — primitivas prontas para o site
   Use direto no HTML ou como base para React/Vue components.
   ============================================================ */

/* —— BUTTON —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  min-height: 44px; /* alvo de toque WCAG */
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  line-height: 1;
  text-decoration: none;   /* <a> não herda sublinhado aqui */
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--duration-base) var(--ease-gentle),
    color            var(--duration-base) var(--ease-gentle),
    border-color     var(--duration-base) var(--ease-gentle),
    transform        var(--duration-fast) var(--ease-spring),
    box-shadow       var(--duration-base) var(--ease-gentle);
}
.btn:hover { text-decoration: none; }

.btn:hover    { transform: translateY(-1px); }
.btn:active   { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background-color: var(--color-brand);
  color: var(--color-text-on-brand);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background-color: var(--color-brand-hover);
  box-shadow: var(--shadow-brand);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-brand);
  border-color: var(--color-border-brand);
}
.btn-secondary:hover {
  background-color: var(--color-brand-subtle);
  border-color: var(--color-brand);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text);
}
.btn-ghost:hover {
  background-color: var(--color-cream-100);
}

.btn-accent {
  background-color: var(--color-accent);
  color: white;
}
.btn-accent:hover { background-color: var(--color-accent-hover); }

.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--text-base); min-height: 52px; }
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); min-height: 36px; }

/* —— CARD —— */
.card {
  background-color: var(--color-surface-raised);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-slow) var(--ease-gentle),
              transform  var(--duration-slow) var(--ease-gentle);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-warm {
  background-color: var(--color-surface-warm);
  border: 1px solid var(--color-border);
}

/* Card psicóloga — replica a estética das artes */
.card-therapist {
  background: var(--gradient-warm);
  border-radius: var(--radius-3xl);
  padding: var(--space-8);
  position: relative;
  overflow: hidden;
}

/* —— INPUT —— */
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition:
    border-color var(--duration-base) var(--ease-gentle),
    background-color var(--duration-base) var(--ease-gentle),
    box-shadow var(--duration-base) var(--ease-gentle);
}
.input::placeholder { color: var(--color-text-subtle); }
.input:hover        { border-color: var(--color-border-strong); }
.input:focus        {
  outline: none;
  border-color: var(--color-border-focus);
  background-color: var(--color-surface-raised);
  box-shadow: 0 0 0 4px var(--color-terracotta-100);
}

/* —— BADGE / TAG —— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-full);
}
.badge-brand   { background: var(--color-brand-subtle);  color: var(--color-terracotta-700); }
.badge-accent  { background: var(--color-accent-subtle); color: var(--color-sage-700); }
.badge-warm    { background: var(--color-mustard-100);   color: var(--color-mustard-600); }

/* —— DIVIDER ORGÂNICO —— */
.divider-organic {
  height: 1px;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-border-strong) 50%,
    transparent 100%
  );
  margin-block: var(--space-12);
}

/* —— BLOB DECORATIVO —— */
.blob {
  position: absolute;
  border-radius: var(--radius-blob-1);
  filter: blur(40px);
  opacity: 0.7;
  pointer-events: none;
  z-index: var(--z-behind);
  animation: blob-morph 18s var(--ease-gentle) infinite;
}
.blob-rose    { background: var(--decor-blob-rose); }
.blob-sage    { background: var(--decor-blob-sage); }
.blob-mustard { background: var(--decor-blob-mustard); }

@keyframes blob-morph {
  0%, 100% { border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%; }
  50%      { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; }
}

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

.text-balance { text-wrap: balance; }
.text-pretty  { text-wrap: pretty; }
