/* ===== FORMULARIO ===== */
#ct-calculadora-form {
  background: #f9fafb;
  border: 1px solid #ddd;
  padding: 20px;
  border-radius: 8px;
  max-width: 600px;
  margin: 0 auto;
  font-family: "Lexend Deca", Sans-serif;
}

#ct-calculadora-form label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
  color: #333;
}

#ct-calculadora-form input,
#ct-calculadora-form select {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
}

#ct-calculadora-form button {
  margin-top: 20px;
  width: 100%;
  background-color: #de2a1b;
  font-family: var(--e-global-typography-primary-font-family), Sans-serif;
  font-weight: var(--e-global-typography-primary-font-weight);
  fill: #F2FCFE;
  color: #F2FCFE;
  border-style: solid;
  border-width: 1px;
  border-color: var(--e-global-color-primary);
  border-radius: 8px;
  box-shadow: 4px 5px 14px 0px rgba(0, 0, 0, 0.2);
  padding: 25px 50px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

#ct-calculadora-form button:hover {
  background-color: #0396C200;
  color: var(--e-global-color-primary);
  border-color: var(--e-global-color-primary);
}

/* Fila con distribución flexible */
.ct-form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.ct-form-row > div {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Responsive formulario */
@media (max-width: 600px) {
  .ct-form-row { flex-direction: column; }
}

/* ===== RESULTADOS ===== */
.ct-result {
  font-family: "Lexend Deca", Sans-serif;
  max-width: 600px;
  margin: 30px auto;
}

/* Tarjeta base (energías, potencias y resúmenes) */
.ct-box {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  background: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.ct-box .ct-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #111827;
}
.ct-box .ct-value {
  font-size: 18px;
  color: red;
  font-weight: bold;
}
/* Hover estilo card */
.ct-box:hover {
  border-color: #de2a1b;
  box-shadow: 0 4px 12px rgba(222, 42, 27, 0.15);
  background: #fff8f8;
  transform: translateY(-2px);
}

/* Contenedor de tarjetas (energías y potencias) */
.ct-result-boxes {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}
/* 3 por fila por defecto */
.ct-result-boxes .ct-box {
  flex: 0 1 calc((100% - 40px) / 3);
}

/* ===== BLOQUES DE RESUMEN ===== */
.ct-result-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}
.ct-box.big { font-size: 16px; }
.ct-box.total { font-size: 20px; font-weight: bold; }
.ct-box.total .ct-value { font-size: 22px; color: red; }

/* ===== MENSAJES DE ERROR ===== */
.ct-error {
  font-family: "Lexend Deca", Sans-serif;
  border: 1px solid #f5c2c0;
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  background: #fdecea;
  color: #b71c1c;
  transition: all 0.3s ease;
}
.ct-error:hover {
  border-color: #de2a1b;
  box-shadow: 0 4px 12px rgba(222, 42, 27, 0.15);
  background: #fff8f8;
  transform: translateY(-2px);
}

/* ===== TABLA DE RESULTADOS (opcional) ===== */
.ct-result-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.ct-result-table th {
  background: #f9fafb; text-align: left; padding: 8px; border: 1px solid #e5e7eb;
}
.ct-result-table td {
  padding: 8px; border: 1px solid #e5e7eb; text-align: right;
}
.ct-result-table tr:nth-child(even) { background: #fdfdfd; }

/* ===== Ajustes específicos para POTENCIAS según cantidad ===== */
.ct-result-boxes.ct-potencias.count-2 .ct-box {
  flex: 0 1 calc((100% - 20px) / 2); /* 2 columnas ocupando todo el ancho */
}
.ct-result-boxes.ct-potencias.count-1 {
  justify-content: center;           /* centrada si hay solo una */
}
.ct-result-boxes.ct-potencias.count-1 .ct-box {
  flex: 0 1 420px;
  max-width: 100%;
}

/* ===== RESPONSIVE tarjetas ===== */
@media (max-width: 900px) {
  .ct-result-boxes .ct-box { flex: 0 1 calc((100% - 20px) / 2); } /* 2 por fila */
}
@media (max-width: 600px) {
  .ct-result-boxes .ct-box { flex: 1 1 100%; } /* 1 por fila */
  .ct-result-boxes.ct-potencias.count-2 .ct-box { flex: 1 1 100%; } /* en móvil igualmente 1 */
}
