:root {
  --bg: #f9f9f9;
  --text: #333;
  --accent: #28a745;
  --error: #f8d7da;
  --success: #d4edda;
  --card: #fff;
  --shadow: rgba(0, 0, 0, 0.1);
}

body.dark-mode {
  --bg: #121212;
  --text: #eee;
  --card: #1e1e1e;
  --shadow: rgba(255, 255, 255, 0.1);
}

body {
  font-family: "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  transition: background 0.3s, color 0.3s;
}

.container {
  max-width: 600px;
  margin: 1rem auto;
  padding: 1rem;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toolbar button {
  margin-left: 0.5rem;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: opacity 0.3s;
}

.toolbar button:hover {
  opacity: 0.8;
}

.tabs {
  display: flex;
  justify-content: space-around;
  margin: 1rem 0;
}

.tab-btn {
  flex: 1;
  padding: 0.7rem;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background-color: #eaeaea;
  transition: background-color 0.3s;
}

.tab-btn.active {
  background-color: var(--accent);
  color: white;
  font-weight: bold;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

.tab-content.active {
  display: block;
}

.calc-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calc-form input {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.btn-calcular {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.btn-calcular:hover {
  opacity: 0.9;
}

.resultado {
  margin-top: 0.8rem;
  padding: 0.7rem;
  border-radius: 6px;
  white-space: pre-line;
  text-align: center;
  font-weight: 500;
  transition: background 0.3s ease;
}

.watermark {
  text-align: center;
  margin-top: 2rem;
  opacity: 0.3;
  font-size: 0.9rem;
}

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

@media (max-width: 500px) {
  .container {
    margin: 0.5rem;
    padding: 0.8rem;
  }

  .tab-btn {
    font-size: 0.9rem;
  }
}
