/* ============================================================
   base.css — Reset e tipografia base
   ============================================================ */

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

html {
    font-size: var(--fonte-base);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--fonte-corpo);
    font-size: var(--t-md);
    line-height: var(--linha);
    color: var(--texto);
    background: var(--fundo);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Headings ------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--fonte-titulo);
    font-weight: 600;
    line-height: 1.25;
    color: var(--texto);
}

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

.page-title {
    font-size: var(--t-2xl);
    font-family: var(--fonte-titulo);
    font-weight: 700;
    color: var(--texto);
    letter-spacing: -.02em;
}

.section-title {
    font-size: var(--t-lg);
    font-family: var(--fonte-titulo);
    font-weight: 600;
    color: var(--primaria);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: var(--t-sm);
    margin-bottom: var(--esp-md);
}

/* ---- Texto ---------------------------------------------- */
p { margin-bottom: var(--esp-md); }
p:last-child { margin-bottom: 0; }

a {
    color: var(--texto-link);
    text-decoration: none;
    transition: color var(--transicao);
}
a:hover { color: var(--texto-link-hover); }

strong, b { font-weight: 600; }
em, i { font-style: italic; }

small { font-size: var(--t-sm); }

.text-muted   { color: var(--texto-muted); }
.text-primaria{ color: var(--primaria); }
.text-sucesso { color: var(--sucesso); }
.text-aviso   { color: var(--aviso); }
.text-perigo  { color: var(--perigo); }
.text-info    { color: var(--info); }

.text-sm  { font-size: var(--t-sm); }
.text-xs  { font-size: var(--t-xs); }
.text-lg  { font-size: var(--t-lg); }
.text-mono{ font-family: var(--fonte-mono); }

/* ---- Listas --------------------------------------------- */
ul, ol { padding-left: var(--esp-lg); }
li { margin-bottom: var(--esp-xs); }

ul.sem-bullet { list-style: none; padding-left: 0; }

/* ---- Imagens -------------------------------------------- */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--borda);
}
.avatar-sm  { width: 32px;  height: 32px; }
.avatar-md  { width: 48px;  height: 48px; }
.avatar-lg  { width: 64px;  height: 64px; }
.avatar-xl  { width: 96px;  height: 96px; }
.avatar-2xl { width: 128px; height: 128px; }

/* ---- HR ------------------------------------------------- */
hr {
    border: none;
    border-top: 1px solid var(--borda);
    margin: var(--esp-lg) 0;
}

/* ---- Code ----------------------------------------------- */
code {
    font-family: var(--fonte-mono);
    font-size: var(--t-sm);
    background: var(--card);
    color: var(--primaria);
    padding: 2px 6px;
    border-radius: var(--raio-sm);
    border: 1px solid var(--borda);
}

pre {
    font-family: var(--fonte-mono);
    font-size: var(--t-sm);
    background: var(--card);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    padding: var(--esp-md);
    overflow-x: auto;
    line-height: 1.5;
}
pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--texto);
}

/* ---- Formulários base ----------------------------------- */
input, select, textarea, button {
    font-family: var(--fonte-corpo);
    font-size: var(--t-md);
}

/* ---- Utilitários de espaço ----------------------------- */
.mt-xs { margin-top:    var(--esp-xs); }
.mt-sm { margin-top:    var(--esp-sm); }
.mt-md { margin-top:    var(--esp-md); }
.mt-lg { margin-top:    var(--esp-lg); }
.mt-xl { margin-top:    var(--esp-xl); }

.mb-xs { margin-bottom: var(--esp-xs); }
.mb-sm { margin-bottom: var(--esp-sm); }
.mb-md { margin-bottom: var(--esp-md); }
.mb-lg { margin-bottom: var(--esp-lg); }
.mb-xl { margin-bottom: var(--esp-xl); }

.p-md  { padding:       var(--esp-md); }
.p-lg  { padding:       var(--esp-lg); }

.gap-sm { gap: var(--esp-sm); }
.gap-md { gap: var(--esp-md); }
.gap-lg { gap: var(--esp-lg); }

/* ---- Utilitários de display ---------------------------- */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-center{ align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-1      { flex: 1; }
.self-center { align-self: center; }
.no-underline { text-decoration: none !important; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--esp-md); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--esp-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--esp-md); }

.hidden  { display: none !important; }
.visible { display: block !important; }

.w-full    { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* ---- Animações de entrada ------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .5; }
}

.animate-fade { animation: fadeIn .3s ease forwards; }
.animate-slide{ animation: slideIn .3s ease forwards; }
