body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: radial-gradient(circle at top, #2e4cff 0, #141628 35%, #050712 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: #f5f5f5;
}

/* Container centralizado */
.container {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

/* Títulos centralizados */
h1, h2 {
  text-align: center;
  color: #ffffff;
}

h1 {
  margin-bottom: 20px;
}

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

/* Cards proporcionais aos campos */
.card {
  background: rgba(15, 23, 42, 0.96);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  margin-bottom: 20px;
  color: #e5e7eb;

  /* largura alinhada com os campos */
  max-width: 400px;      /* um pouco maior que 350px */
  margin-left: auto;
  margin-right: auto;
}

/* Grupos de input */
.input-group {
  margin-bottom: 15px;
}

/* Centraliza texto dos labels e unidades */
label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 0.95rem;
  color: #c7d2fe;
  text-align: center;
}

.unit-label {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: center;
}

/* Campos com tamanho original */
input[type="number"],
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 16px;
  background-color: #111827;
  color: #f5f5f5;
}

/* Limita comprimento dos campos e centraliza */
.card .input-group input[type="number"],
.card .input-group select,
.card .input-group .select-wrapper {
  max-width: 350px;
  margin: 0 auto;
  display: block;
}

/* Select com wrapper para seta customizada */
.select-wrapper {
  position: relative;
  display: block;
}

.select-wrapper select {
  width: 100%;
  padding: 10px 36px 10px 10px; /* espaço para a seta */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.select-wrapper::after {
  content: "";
  position: absolute;
  pointer-events: none;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background:
    linear-gradient(45deg, transparent 50%, #a5b4fc 50%) left   /50% 100% no-repeat,
    linear-gradient(-45deg, transparent 50%, #a5b4fc 50%) right /50% 100% no-repeat;
  opacity: 0.9;
}

/* Switch centralizado */
.toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: #9ca3af;
}

#label-opcao-grandeza,
#label-opcao-corrente {
  font-weight: 600;
  color: #c7d2fe;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #4b5563;
  transition: 0.25s;
  border-radius: 999px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: #ffffff;
  transition: 0.25s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #22c55e;
}

.switch input:checked + .slider:before {
  transform: translateX(22px);
}

/* Botão com mesmo comprimento dos campos */
button {
  width: 100%;
  max-width: 350px;      /* igual aos inputs/selects */
  margin: 10px auto 0;   /* centralizado */
  display: block;
  padding: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #0056b3;
}

/* Modal / Pop-up */
.modal {
  display: none; /* Escondido por padrão */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5); /* Fundo escurecido */
}

.modal-content {
  background-color: #fff;
  margin: 15% auto;
  padding: 20px 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-button {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: #000;
  text-decoration: none;
}

footer {
  text-align: center;
  margin-top: 30px;
  color: #ddd;
  font-size: 0.85rem;
}

#resultado-popup {
  font-size: 1.2em;
  font-weight: bold;
  color: #007bff;
}
