/* ===== FORMULARIO PRINCIPAL ===== */
form[name="fObtenerLecturas"] {
  width: 100%;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 25px;
}

fieldset {
  border: none;
  padding: 0;
}

legend {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 20px;
  display: block;
  width: 100%;
}

/* ===== DISEÑO EN LÍNEA PARA DESKTOP ===== */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  align-items: center;
}

.input-group {
  flex: 1;
  min-width: 200px;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #495057;
}

.input-group select,
.input-group input[type="datetime-local"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 15px;
}

/* ===== GRUPO COMBINADO (CHECKBOX + RADIOS) ===== */
.combined-group {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  width: 100%;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.checkbox-group input[type="checkbox"] {
  transform: scale(1.3);
}

.radio-group {
  flex: 1;
}

.radio-options {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: nowrap; /* Evita que se rompa la línea */
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap; /* Evita que el texto se divida */
}

.radio-option input[type="radio"] {
  transform: scale(1.3);
  margin: 0;
}

/* ===== BOTÓN ===== */
.submit-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 4px;
  cursor: pointer;
  margin: 20px 0 0 0;
  transition: background-color 0.3s;
  margin-right: auto;
  margin-left: 0;
  width: auto;
  min-width: 120px;
  display: inline-block;
}

.submit-btn:hover {
  background-color: #45a049;
}

/* ===== MENSAJES DE ERROR ===== */
.error-message {
  color: #d32f2f;
  text-align: center;
  margin-top: 15px;
  font-weight: 500;
}

/* ===== GRÁFICAS ===== */
.Grafica_padre {
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.Grafica_hija:first-child {
  flex: 0 0 100%;
  position: relative;
}

.Grafica_hija:first-child::before {
  content: "";
  display: block;
  padding-top: 33.33%;
}

.Grafica_hija {
  flex: 0 0 calc(50% - 5px);
  position: relative;
  overflow: hidden;
}

.Grafica_hija:not(:first-child)::before {
  content: "";
  display: block;
  padding-top: 100%;
}

.Grafica_hija canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.Grafica_padre > .Grafica_hija:last-child:nth-child(even) {
  margin-right: auto;
}

/* ===== MEDIA QUERIES (RESPONSIVE) ===== */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .input-group {
    width: 100%;
  }
  
  .checkbox-group {
    margin-top: 0;
    align-self: flex-start;
  }
  
  .submit-btn {
    max-width: 100%;
  }

  .combined-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .radio-options {
    flex-direction: column;
    width: 100%;
    gap: 8px;
    align-items: flex-start;
  }
  
  .radio-option {
    width: 100%;
  }

  .Grafica_hija {
    flex: 0 0 100% !important;
    margin-right: 0 !important;
  }

  .Grafica_hija:first-child::before {
    padding-top: 100%; 
  }
  
  .Grafica_hija:not(:first-child)::before {
    padding-top: 100%;
  }
}
