/* =====================================================
   TOKENS DE TEMA (cores, raios, sombras)
===================================================== */
:root{
  /* raios e sombras base */
  --radius-lg: 20px;
  --radius-md: 16px;

  /* aliases úteis (desktop) */
  --radius: var(--radius-md);
  --radius-full: 999px;

  --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
  --shadow-md: 0 6px 18px rgba(15,23,42,0.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);

  /* CLARO (default) */
  --app-bg: #000000;
  --surface: #18181b;
  --surface-soft: #27272a;

  --ink-900:#ECEDEE;
  --ink-700:#d4d4d8;
  --ink-600:#a1a1aa;
  --ink-500:#71717a;
  --ink-400:#52525b;
  --ink-100: #3f3f46;

  --primary-500:#006FEE;
  --primary-600:#006FEE;

  --border-soft: #ffffff26;

  /* compat */
  --shadow: var(--shadow-md);
  --line: #ffffff26;

  --act-icon-color: var(--primary-600);
  --act-text-color: var(--ink-900);

  /* Timeline */
  --tl-bubble-bg: var(--surface);
  --tl-bubble-border: var(--border-soft);

  --tl-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 20px rgba(15, 23, 42, 0.05);

  --tl-rail: color-mix(in srgb, var(--ink-400) 35%, transparent);
  --tl-dot: color-mix(in srgb, var(--ink-400) 70%, transparent);
  --tl-dot-ring: color-mix(in srgb, var(--surface) 70%, transparent);

  --tl-dot-active: var(--primary-600);
  --tl-dot-active-ring: color-mix(in srgb, var(--primary-600) 18%, transparent);
}

/* ESCURO */
:root[data-theme="dark"] {
  color-scheme: dark;

  --app-bg: #000000;
  --surface: #18181b;
  --surface-soft: #27272a;

  --ink-900:#ECEDEE;
  --ink-700:#d4d4d8;
  --ink-600:#a1a1aa;
  --ink-500:#71717a;
  --ink-400:#52525b;
  --ink-100: #3f3f46;

  --primary-500:#006FEE;
  --primary-600:#006FEE;

  --border-soft: #ffffff26;

  --shadow-sm: 0 4px 12px rgba(255,255,255,0.03);
  --shadow-md: 0 6px 18px rgba(255,255,255,0.04);
  --shadow-lg: 0 10px 30px rgba(255,255,255,0.05);

  /* Timeline */
  --tl-bubble-bg: var(--surface-soft);
  --tl-bubble-border: rgba(255,255,255,.08);

  --tl-shadow:
    0 6px 18px rgba(0,0,0,.55),
    0 1px 0 rgba(255,255,255,.04);

  --tl-rail: rgba(255,255,255,.14);
  --tl-dot: rgba(255,255,255,.28);
  --tl-dot-ring: rgba(0,0,0,.45);

  --tl-dot-active: var(--primary-500);
  --tl-dot-active-ring: rgba(96,165,250,.35);
}

/* =====================================================
   BASE / RESET
===================================================== */

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

html, body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, sans-serif;
  min-height: 100%;
  background-color: var(--app-bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--app-bg);
  z-index: -1;
}

/* Fade-in controlado pelo JS */
body.invisible {
  visibility: hidden;
  opacity: 0;
  transition: opacity 1s ease-out, visibility 0s linear 1s;
}
body:not(.invisible) {
  visibility: visible;
  opacity: 1;
  transition: opacity 1s ease-out;
}

/* Container principal (DESKTOP) */
.wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  max-width: 1120px;
  margin: 0 auto;
}

/* Aplicação dos tokens principais */
body { background-color: var(--app-bg); color: var(--ink-900); }


/* =====================================================
   TIPOGRAFIA GLOBAL E LINKS (escala unificada)
===================================================== */
html { font-size: 16px; }
body { line-height: 1.5; font-size: 1rem; }

h1, .title-lg {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--ink-900);
  line-height: 1.2;
  margin: 0;
}

h2, .title-md, .section__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink-900);
  margin: 0 0 8px;
}

p, .text-base      { font-size: 1rem;  color: var(--ink-600); margin: 0; }
.text-sm           { font-size: 0.9rem; color: var(--ink-500); }
.text-xs           { font-size: 0.8rem; font-weight: 600; color: var(--ink-400); letter-spacing: 0.2px; }

a { text-decoration: none; color: inherit; }
a:hover, a:active { opacity: 0.85; }

h1 + p, h2 + p { margin-top: 4px; }


/* =====================================================
   TOASTS (Fundo centrado)
===================================================== */

.toasts {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;

  pointer-events: none; /* não bloqueia cliques */
}

/* Toast base */
.toast {
  pointer-events: none;

  width: min(420px, calc(100vw - 32px));
  border-radius: 16px;
  padding: 14px 16px;

  box-shadow: 0 12px 28px rgba(0,0,0,.25);

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;

  color: #fff;

  opacity: 0;
  transform: translateY(24px); /* 👈 vem de baixo */
  transition: transform 260ms ease, opacity 260ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-hiding {
  opacity: 0;
  transform: translateY(24px);
}

/* Texto */
.toast__msg {
  font-weight: 700;
  line-height: 1.2;
  font-size: 15px;
}

.toast__detail {
  font-size: 13px;
  line-height: 1.3;
  opacity: 0.9;

  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tipos */
.toast--success { background: #0f5132; }
.toast--info    { background: #084298; }
.toast--warning { background: #664d03; }
.toast--error   { background: #842029; }

/* =====================================================
    Botão de tema (opcional) 
===================================================== */
.theme-toggle{
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:12px; border:1px solid var(--border-soft);
  background: var(--surface-soft); color: var(--ink-900);
  box-shadow: var(--shadow-sm);
}
.theme-toggle:hover{ opacity:.9; }


/* =====================================================
   BLOCO GENÉRICO: SECTION
===================================================== */
.section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 0;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-soft);
}

/* ============================*/
/* base neutra do botão        */
/* ============================*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem .875rem;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
}

.btn--sm { padding: .4rem .6rem; border-radius: 10px; font-size: .9rem; }
.btn--lg { padding: .8rem 1rem;   border-radius: 14px; font-size: 1.05rem; }

.btn:disabled { opacity: .6; cursor: not-allowed; }


/* =====================================================
   UTILITÁRIOS — VISIBILIDADE
===================================================== */

/* Esconde completamente (remove do layout) */
.is-hidden {
  display: none !important;
}

/* Invisível mas mantém espaço no layout */
.is-invisible {
  visibility: hidden !important;
}

/* Invisível + sem interação (bom para animações) */
.is-transparent {
  opacity: 0 !important;
  pointer-events: none !important;
}


/* esconde durante a troca de página */
#app.is-switching{
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}


#app{
  opacity: 1;
  transition: opacity 140ms ease;
}


