/* ===== VARIÁVEIS ===== */
:root {
  --bg-page: #f3f4f6;
  --bg-card: #ffffff;
  --text-main: #111827;
  --text-muted: #4b5563;
  --border: #d1d5db;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #2563eb;
}

/* ===== RESET BÁSICO ===== */
* {
  box-sizing: border-box;
}

/* ===== ESTILO GERAL ===== */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
}

/* ===== CONTAINER ===== */
.container {
  width: 90%;
  max-width: 420px;
  margin: 60px auto;
  padding: 20px;
}

/* ===== TÍTULO ===== */
.titulo {
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.titulo::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: var(--blue);
  margin: 10px auto 0;
  border-radius: 2px;
}

.subtitulo {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 30px;
  font-size: 1.1rem;
}

/* ===== BLOCOS ===== */
.balance-card,
.card,
form {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

/* ===== SALDO ===== */
.balance-card {
  text-align: center;
}

/* ===== CARDS LADO A LADO ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.card {
  text-align: center;
}

.income-card {
  border-bottom: 4px solid var(--green);
}

.expense-card {
  border-bottom: 4px solid var(--red);
}

/* ===== VALORES ===== */
#money-plus {
  color: var(--green);
  font-weight: bold;
}

#money-minus {
  color: var(--red);
  font-weight: bold;
}

/* ===== TRANSAÇÕES ===== */
.transactions {
  list-style: none;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.transactions li {
  background: var(--bg-card);
  padding: 12px;
  border-radius: 10px;

  display: flex;
  flex-direction: column;
  gap: 6px;

  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.transactions li.plus {
  border-right: 4px solid var(--green);
}

.transactions li.minus {
  border-right: 4px solid var(--red);
}

/* ===== BOTÃO EXCLUIR ===== */
.delete-btn {
  align-self: flex-end;
  background: var(--red);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
}

.delete-btn:hover {
  opacity: 0.85;
}

/* ===== FORMULÁRIO ===== */
.form-control {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

small {
  display: block;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ===== INPUTS ===== */
input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
}

input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* ===== BOTÃO PRINCIPAL ===== */
.btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.9;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 500px) {
  .transactions {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .titulo {
    font-size: 2.2rem;
  }
}
