/* ========== RESET BÁSICO ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ========== TIPOGRAFIA E CORES GERAIS ========== */
:root {
  --cor-primaria: #2c3e50;
  --cor-secundaria: #ecf0f1;
  --cor-accent: #e67e22;
  --cor-erro: #c0392b;
  --font-base: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  font-family: var(--font-base);
  background-color: var(--cor-secundaria);
  color: var(--cor-primaria);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
}

/* ========== CONTAINER PRINCIPAL ========== */
.container {
  width: 100%;
  max-width: 480px;
  background-color: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0,0,0,0.08);
}

/* ========== TÍTULO ========== */
h1 {
  font-size: 1.75rem;
  margin-bottom: 16px;
  text-align: center;
}

/* ========== BANNERS DE ANÚNCIO ========== */
.ad-banner {
  margin: 16px 0;
}

/* ========== FORMULÁRIO ========== */
.calculator-section {
  margin-top: 8px;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

label {
  font-weight: 600;
  margin-bottom: 4px;
}

input[type="number"],
select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  width: 100%;
}

input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--cor-accent);
}

/* Botão principal */
button#calcularBtn {
  background-color: var(--cor-accent);
  color: #fff;
  font-size: 1rem;
  padding: 10px 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

button#calcularBtn:hover {
  background-color: #d35400;
}

/* ========== RESULTADO ========== */
.resultado {
  margin-top: 24px;
  padding: 16px;
  background-color: #f9f9f9;
  border-left: 4px solid var(--cor-accent);
  border-radius: 4px;
  min-height: 60px;
}

.resultado p {
  margin-bottom: 8px;
}

.resultado .erro {
  color: var(--cor-erro);
  font-weight: 600;
}

/* ========== AJUDA VISUALMENTE OCULTA (Acessibilidade) ========== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ========== RESPONSIVIDADE ========== */
@media (max-width: 360px) {
  .container {
    padding: 16px;
  }

  h1 {
    font-size: 1.5rem;
  }
}

/* ========== RESULTADO (FORMATAÇÃO APRIMORADA PARA 3 COLUNAS) ========== */
.resultado {
  margin-top: 24px;
  background-color: #fcfcfc;
  border: 2px solid var(--cor-accent);
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.resultado h2 {
  font-size: 1.25rem;
  color: var(--cor-primaria);
  margin-bottom: 12px;
  text-align: center;
}

.resultado table {
  width: 100%;
  border-collapse: collapse;
}

.resultado th,
.resultado td {
  padding: 10px 8px;
  text-align: left;
}

.resultado th {
  background-color: var(--cor-accent);
  color: #fff;
  font-weight: 600;
}

.resultado tbody tr:nth-child(even) {
  background-color: #f2f2f2;
}

.resultado td {
  font-size: 1rem;
}

.resultado .erro {
  color: var(--cor-erro);
  font-weight: 600;
  text-align: center;
}

/* RESPONSIVIDADE: adapta tabela de 3 colunas para celulares estreitos */
@media (max-width: 380px) {
  .resultado table,
  .resultado thead,
  .resultado tbody,
  .resultado th,
  .resultado td,
  .resultado tr {
    display: block;
    width: 100%;
  }
  .resultado thead {
    display: none;
  }
  .resultado tr {
    margin-bottom: 12px;
  }
  .resultado td {
    display: flex;
    justify-content: space-between;
    padding: 8px 4px;
  }
  .resultado td::before {
    content: attr(data-label);
    font-weight: 600;
  }
}


