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

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================
   TEMAS
========================= */

body[data-theme="dark"] {
  background-color: #0f172a;
  color: #e5e7eb;
}

body[data-theme="light"] {
  background-color: #f8fafc;
  color: #020617;
}

/* =========================
   LAYOUT
========================= */

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

h1 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

/* =========================
   CARDS
========================= */

.card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: background-color 0.3s ease;
}

/* cores dos cards por tema */
body[data-theme="dark"] {
  --card-bg: #020617;
}

body[data-theme="light"] {
  --card-bg: #ffffff;
}

/* =========================
   INPUTS & BOTÕES
========================= */

input,
button {
  width: 100%;
  padding: 0.75rem;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
}

input {
  margin-bottom: 0.6rem;
}

body[data-theme="dark"] input {
  background: #1e293b;
  color: #e5e7eb;
}

body[data-theme="light"] input {
  background: #e5e7eb;
  color: #020617;
}

button {
  background: #6366f1;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:active {
  transform: scale(0.97);
}

button:hover {
  opacity: 0.9;
}

/* =========================
   BOTÃO DE TEMA
========================= */

#themeToggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #6366f1;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

/* =========================
   LISTA
========================= */

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

li {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

li button {
  align-self: flex-start;
}

.done {
  text-decoration: line-through;
  opacity: 0.6;
}

.small {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* =========================
   GRÁFICO
========================= */

canvas {
  max-width: 100%;
}

/* =========================
   DESKTOP
========================= */

@media (min-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .container {
    max-width: 900px;
  }

  li {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  li button {
    width: auto;
  }
}
