/* base.css — reset, variáveis CSS, tipografia */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* Modo escuro (padrão) */
  --bg:       #0c0c0e;
  --bg2:      #141416;
  --bg3:      #1c1c20;
  --bg4:      #242428;
  --border:   rgba(255,255,255,0.08);
  --border2:  rgba(255,255,255,0.14);
  --text:     #f0f0f0;
  --text2:    #909098;
  --text3:    #55555f;
  --accent:   #6c63ff;
  --accent2:  #8b85ff;
  --accent-bg: rgba(108,99,255,0.12);
  --green:    #3ecf8e;
  --amber:    #f5a623;
  --red:      #ff5c5c;
  --blue:     #4da3ff;

  /* Tipografia */
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;

  /* Tamanhos */
  --fs-label:  11px;
  --fs-meta:   12px;
  --fs-sm:     13px;
  --fs-body:   14px;
  --fs-sub:    16px;
  --fs-title:  18px;
  --fs-h:      22px;
  --fs-display:28px;

  /* Espaçamentos */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl:24px;
  --space-3xl:32px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl:20px;
  --r-full: 9999px;

  /* Transições */
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
  --t-slow: 320ms ease;
}

[data-theme="light"] {
  --bg:       #f8f8fa;
  --bg2:      #ffffff;
  --bg3:      #f0f0f4;
  --bg4:      #e8e8ec;
  --border:   rgba(0,0,0,0.08);
  --border2:  rgba(0,0,0,0.14);
  --text:     #0c0c0e;
  --text2:    #5a5a62;
  --text3:    #9a9aa2;
}

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

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

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Tipografia */
h1 { font-size: var(--fs-display); font-weight: 500; line-height: 1.2; }
h2 { font-size: var(--fs-h); font-weight: 500; line-height: 1.3; }
h3 { font-size: var(--fs-title); font-weight: 500; line-height: 1.4; }
h4 { font-size: var(--fs-sub); font-weight: 500; }
h5 { font-size: var(--fs-body); font-weight: 500; }

p { line-height: 1.6; }

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { list-style: none; }

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

button, input, select, textarea {
  font-family: var(--font);
  font-size: var(--fs-body);
  color: var(--text);
}

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

input, select, textarea {
  outline: none;
  border: none;
  background: none;
}

/* Números e valores monetários */
.mono, .value, .amount {
  font-family: var(--font-mono);
  font-weight: 500;
}

/* Cores semânticas */
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-amber  { color: var(--amber); }
.text-blue   { color: var(--blue); }
.text-accent { color: var(--accent2); }
.text-muted  { color: var(--text2); }
.text-dim    { color: var(--text3); }

/* Utilitários */
.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;
}

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

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: var(--r-full); }

/* Seleção de texto */
::selection { background: var(--accent-bg); color: var(--accent2); }

/* Animações globais */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes checkmark {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
