/* ============================================================
   MedAlerta — Reset + Tipografia
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-app);
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* ── Tamanho de Fonte Configurável ───────────────────────── */
[data-font-size="normal"]  { font-size: 16px; }
[data-font-size="large"]   { font-size: 18px; }
[data-font-size="xlarge"]  { font-size: 20px; }

/* ── Tipografia ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

p {
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--brand-hover); }

strong { font-weight: var(--font-weight-semibold); }
em     { font-style: italic; }
small  { font-size: var(--font-size-sm); }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar         { width: 6px; height: 6px; }
::-webkit-scrollbar-track   { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb   { background: var(--scrollbar-thumb); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-neutral-400); }

/* ── Seleção ─────────────────────────────────────────────── */
::selection {
  background: var(--brand);
  color: var(--text-on-primary);
}

/* ── Focus visible ───────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Imagens e media ─────────────────────────────────────── */
img, video, svg {
  display: block;
  max-width: 100%;
}

/* ── Listas ──────────────────────────────────────────────── */
ul, ol { list-style: none; }

/* ── Inputs base ─────────────────────────────────────────── */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

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

/* ── HR ──────────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: var(--space-4) 0;
}

/* ── Classes utilitárias de texto ────────────────────────── */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }
.text-brand     { color: var(--brand); }
.text-success   { color: var(--color-success-500); }
.text-warning   { color: var(--color-warning-500); }
.text-danger    { color: var(--color-danger-500); }

.text-xs   { font-size: var(--font-size-xs); }
.text-sm   { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-md   { font-size: var(--font-size-md); }
.text-lg   { font-size: var(--font-size-lg); }
.text-xl   { font-size: var(--font-size-xl); }

.font-medium   { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold     { font-weight: var(--font-weight-bold); }

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Layout utilitários ──────────────────────────────────── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center{ align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

.grid        { display: grid; }
.w-full      { width: 100%; }
.h-full      { height: 100%; }
.min-h-screen{ min-height: 100dvh; }

.hidden      { display: none !important; }
.invisible   { visibility: hidden; }
.sr-only     {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

.p-4   { padding: var(--space-4); }
.p-6   { padding: var(--space-6); }
.px-4  { padding-inline: var(--space-4); }
.py-4  { padding-block:  var(--space-4); }
.mb-4  { margin-bottom: var(--space-4); }
.mt-4  { margin-top: var(--space-4); }
.mb-2  { margin-bottom: var(--space-2); }

.rounded-full { border-radius: var(--radius-full); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-md   { border-radius: var(--radius-md); }

.overflow-hidden { overflow: hidden; }
.relative        { position: relative; }
.absolute        { position: absolute; }
.fixed           { position: fixed; }
.sticky          { position: sticky; }
.inset-0         { inset: 0; }

.opacity-0       { opacity: 0; }
.opacity-50      { opacity: 0.5; }
.pointer-events-none { pointer-events: none; }
