/* ============================================================
   MEDPREV DESIGN SYSTEM · MAIN BUNDLE
   ------------------------------------------------------------
   Importa todos os módulos do sistema. Use ESTE arquivo
   no <link> do HTML — ele garante a ordem correta de cascata.

   Ordem da cascata (não alterar):
     1. tokens        — variáveis fundacionais
     2. themes        — overrides de light/dark/auto
     3. base/reset    — defaults globais (este arquivo)
     4. layout        — grid, container, app shell
     5. forms         — inputs e validation
     6. components    — todos os componentes
     7. animations    — keyframes
     8. utilities     — última, sempre vence (override)
   ============================================================ */

@import url("./medprev.tokens.css");
@import url("./medprev.themes.css");
@import url("./medprev.layout.css");
@import url("./medprev.forms.css");
@import url("./medprev.components.css");
@import url("./medprev.animations.css");
@import url("./medprev.utilities.css");

/* ============================================================
   RESET MODERNO + BASE
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  border-color: var(--mp-border);
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  font-family: var(--mp-font-sans);
  font-size: 16px;
  line-height: var(--mp-lh-normal);
  scroll-behavior: smooth;
}

body {
  font-family: var(--mp-font-sans);
  font-size: var(--mp-fs-md);
  font-weight: var(--mp-fw-medium);
  line-height: var(--mp-lh-normal);
  color: var(--mp-text);
  background: var(--mp-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Headings reset (use .mp-h1..h6 utilities for styled headings) */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  letter-spacing: inherit;
}

p { margin: 0; }

a {
  color: var(--mp-text-link);
  text-decoration: none;
  transition: color var(--mp-duration-fast) var(--mp-ease-out);
}
a:hover { color: var(--mp-text-link-hover); }
a:focus-visible {
  outline: var(--mp-ring-width) solid var(--mp-ring-color);
  outline-offset: 2px;
  border-radius: var(--mp-radius-xs);
}

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

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

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

ul, ol { list-style: none; padding: 0; margin: 0; }

table {
  border-collapse: collapse;
  border-spacing: 0;
}

code, kbd, samp, pre {
  font-family: var(--mp-font-mono);
  font-size: 0.92em;
}

hr {
  border: 0;
  border-top: 1px solid var(--mp-border);
  margin: 0;
}

/* Global focus-visible default */
:focus-visible {
  outline: var(--mp-ring-width) solid var(--mp-ring-color);
  outline-offset: var(--mp-ring-offset);
  border-radius: var(--mp-radius-xs);
}

/* Selection */
::selection {
  background: var(--mp-brand-soft);
  color: var(--mp-brand);
}

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--mp-border-strong);
  border-radius: var(--mp-radius-full);
  border: 3px solid var(--mp-bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--mp-text-muted); }

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--mp-border-strong) transparent;
}

/* ============================================================
   TYPOGRAPHY PRESETS (componentes semânticos)
   ============================================================ */

.mp-display {
  font-size: var(--mp-fs-6xl);
  font-weight: var(--mp-fw-extrabold);
  line-height: var(--mp-lh-tight);
  letter-spacing: var(--mp-ls-tighter);
  color: var(--mp-text-strong);
}

.mp-h1 {
  font-size: var(--mp-fs-4xl);
  font-weight: var(--mp-fw-extrabold);
  line-height: var(--mp-lh-tight);
  letter-spacing: var(--mp-ls-tight);
  color: var(--mp-text-strong);
}

.mp-h2 {
  font-size: var(--mp-fs-3xl);
  font-weight: var(--mp-fw-extrabold);
  line-height: var(--mp-lh-snug);
  letter-spacing: var(--mp-ls-tight);
  color: var(--mp-text-strong);
}

.mp-h3 {
  font-size: var(--mp-fs-2xl);
  font-weight: var(--mp-fw-bold);
  line-height: var(--mp-lh-snug);
  color: var(--mp-text-strong);
}

.mp-h4 {
  font-size: var(--mp-fs-xl);
  font-weight: var(--mp-fw-bold);
  line-height: var(--mp-lh-snug);
  color: var(--mp-text-strong);
}

.mp-h5 {
  font-size: var(--mp-fs-lg);
  font-weight: var(--mp-fw-semibold);
  line-height: var(--mp-lh-normal);
  color: var(--mp-text-strong);
}

.mp-h6 {
  font-size: var(--mp-fs-md);
  font-weight: var(--mp-fw-semibold);
  line-height: var(--mp-lh-normal);
  color: var(--mp-text-strong);
}

.mp-lead {
  font-size: var(--mp-fs-lg);
  font-weight: var(--mp-fw-medium);
  line-height: var(--mp-lh-relaxed);
  color: var(--mp-text-soft);
}

.mp-body {
  font-size: var(--mp-fs-md);
  font-weight: var(--mp-fw-medium);
  line-height: var(--mp-lh-normal);
  color: var(--mp-text);
}

.mp-small {
  font-size: var(--mp-fs-sm);
  font-weight: var(--mp-fw-medium);
  color: var(--mp-text-soft);
}

.mp-caption {
  font-size: var(--mp-fs-xs);
  font-weight: var(--mp-fw-medium);
  color: var(--mp-text-soft);
}

.mp-eyebrow {
  font-size: var(--mp-fs-2xs);
  font-weight: var(--mp-fw-extrabold);
  text-transform: uppercase;
  letter-spacing: var(--mp-ls-widest);
  color: var(--mp-brand);
}

.mp-kbd {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 var(--mp-space-2);
  font-family: var(--mp-font-mono);
  font-size: var(--mp-fs-2xs);
  font-weight: var(--mp-fw-bold);
  color: var(--mp-text-soft);
  background: var(--mp-surface);
  border: 1px solid var(--mp-border);
  border-bottom-width: 2px;
  border-radius: var(--mp-radius-sm);
}

.mp-code-inline {
  font-family: var(--mp-font-mono);
  font-size: 0.88em;
  font-weight: var(--mp-fw-semibold);
  padding: 2px 6px;
  background: var(--mp-bg-muted);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-xs);
  color: var(--mp-text-strong);
}

/* Visually hidden — para labels acessíveis */
.mp-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;
}
