:root {
  --bg: #121212; /* Fondo oscuro */
  --card: #1E1E1E; /* Fondo de las cards */
  --accent: #00BFA6; /* Verde menta para acentos */
  --muted: #B0B0B0; /* Texto secundario */
  --danger: #EF5350; /* Rojo más vibrante para errores */
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, Arial;
  background-color: var(--bg);
  color: #E0E0E0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
}

.container {
  width: 100%;
  max-width: 900px;
}

h1 {
  margin: 0 0 6px;
  font-size: 1.6rem;
}
.subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  text-align: left;
}

.cards-wrapper {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  flex: 1 1 320px;
  max-width: 380px; 
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

label {
  display: block;
  font-size: 0.9rem;
  margin: 8px 0 4px;
  color: #E0E0E0;
}

input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2C2C2C;
  background-color: #121212;
  color: #E0E0E0;
  font-size: 1rem;
  outline: none;
}

input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 191, 166, 0.3);
}

.row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #121212;
  font-weight: 600;
  font-size: 0.95rem;
}

button.secondary {
  background: #263230;
  color: var(--accent);
  font-weight: 600;
  border: 1px solid rgba(0, 191, 166, 0.3);
}

.error {
  margin-top: 10px;
  color: var(--danger);
  font-weight: 600;
}

.result {
  margin-top: 10px;
  color: #E0E0E0;
  word-break: break-word;
  background: #1A1A1A;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #2C2C2C;
}

.footer {
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 768px) {
  .cards-wrapper {
    flex-direction: column;
    align-items: center;
  }
  .card {
    max-width: 100%;
  }
}